diff options
author | Rich Trott <rtrott@gmail.com> | 2020-06-26 07:20:23 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-06-29 06:26:27 +0300 |
commit | 95eecd58b39b7dbedfce509b4a38d0c18e22f7cb (patch) | |
tree | f07a0353248255bbc8fb65af02753e2696c79cf0 /doc/api/esm.md | |
parent | b327d335ff6bc48c3c2aaedccfa9c40522f6b32f (diff) |
doc: improve paragraph in esm.md
Edit for clarity, correct tense, and brevity.
PR-URL: https://github.com/nodejs/node/pull/34064
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'doc/api/esm.md')
-rw-r--r-- | doc/api/esm.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md index eca866e452b..06a9f89ee57 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -124,12 +124,12 @@ as ES modules and `.cjs` files are always treated as CommonJS. ### Package scope and file extensions A folder containing a `package.json` file, and all subfolders below that folder -down until the next folder containing another `package.json`, is considered a -_package scope_. The `"type"` field defines how `.js` files should be treated -within a particular `package.json` file’s package scope. Every package in a +until the next folder containing another `package.json`, are a +_package scope_. The `"type"` field defines how to treat `.js` files +within the package scope. Every package in a project’s `node_modules` folder contains its own `package.json` file, so each -project’s dependencies have their own package scopes. A `package.json` lacking a -`"type"` field is treated as if it contained `"type": "commonjs"`. +project’s dependencies have their own package scopes. If a `package.json` file +does not have a `"type"` field, the default `"type"` is `"commonjs"`. The package scope applies not only to initial entry points (`node my-app.js`) but also to files referenced by `import` statements and `import()` expressions. |