Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: naming of files in example code should be consistent #5043

Merged
merged 1 commit into from Jul 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/content/using-npm/workspaces.md
Expand Up @@ -57,7 +57,7 @@ structure of files and folders:
```
.
+-- node_modules
| `-- packages/a -> ../packages/a
| `-- a -> ../packages/a
+-- package-lock.json
+-- package.json
`-- packages
Expand Down Expand Up @@ -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
```

Expand Down