Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen XI <xichen1427@gmail.com>2022-07-11 23:32:18 +0300
committerGitHub <noreply@github.com>2022-07-11 23:32:18 +0300
commit25b305830be0892bbbf0245aee2eebdb76ee2ce3 (patch)
treea9d30091a440b5a163e882911683f1ad0baee981
parentda5a4ba2c83af9a7e5e0fe38c32136adf396f557 (diff)
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.
-rw-r--r--docs/content/using-npm/workspaces.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/content/using-npm/workspaces.md b/docs/content/using-npm/workspaces.md
index 26d6a5d75..82491cd74 100644
--- a/docs/content/using-npm/workspaces.md
+++ b/docs/content/using-npm/workspaces.md
@@ -57,7 +57,7 @@ structure of files and folders:
```
.
+-- node_modules
-| `-- packages/a -> ../packages/a
+| `-- a -> ../packages/a
+-- package-lock.json
+-- package.json
`-- packages
@@ -112,15 +112,15 @@ respect the provided `workspace` configuration.
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
by its declared `package.json` `name`. Continuing from the example defined
-above, let's also create a Node.js script that will require the `workspace-a`
+above, let's also create a Node.js script that will require the workspace `a`
example module, e.g:
```
-// ./workspace-a/index.js
+// ./packages/a/index.js
module.exports = 'a'
// ./lib/index.js
-const moduleA = require('workspace-a')
+const moduleA = require('a')
console.log(moduleA) // -> a
```