Skip to content

Commit 25b3058

Browse files
authored
docs: naming of files in example code should be consistent (#5043)
The use of `a` workspace have some inconsistency in terms of naming, making the doc not easy to follow.
1 parent da5a4ba commit 25b3058

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/content/using-npm/workspaces.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ structure of files and folders:
5757
```
5858
.
5959
+-- node_modules
60-
| `-- packages/a -> ../packages/a
60+
| `-- a -> ../packages/a
6161
+-- package-lock.json
6262
+-- package.json
6363
`-- packages
@@ -112,15 +112,15 @@ respect the provided `workspace` configuration.
112112

113113
Given the [specifities of how Node.js handles module resolution](https://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_all_together) it's possible to consume any defined workspace
114114
by its declared `package.json` `name`. Continuing from the example defined
115-
above, let's also create a Node.js script that will require the `workspace-a`
115+
above, let's also create a Node.js script that will require the workspace `a`
116116
example module, e.g:
117117

118118
```
119-
// ./workspace-a/index.js
119+
// ./packages/a/index.js
120120
module.exports = 'a'
121121
122122
// ./lib/index.js
123-
const moduleA = require('workspace-a')
123+
const moduleA = require('a')
124124
console.log(moduleA) // -> a
125125
```
126126

0 commit comments

Comments
 (0)