Skip to content

Commit 21b0132

Browse files
Trottaddaleax
authored andcommitted
doc: improve paragraph in esm.md
Edit for clarity, correct tense, and brevity. PR-URL: #34064 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 66cd7bf commit 21b0132

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/api/esm.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ as ES modules and `.cjs` files are always treated as CommonJS.
124124
### Package scope and file extensions
125125

126126
A folder containing a `package.json` file, and all subfolders below that folder
127-
down until the next folder containing another `package.json`, is considered a
128-
_package scope_. The `"type"` field defines how `.js` files should be treated
129-
within a particular `package.json` file’s package scope. Every package in a
127+
until the next folder containing another `package.json`, are a
128+
_package scope_. The `"type"` field defines how to treat `.js` files
129+
within the package scope. Every package in a
130130
project’s `node_modules` folder contains its own `package.json` file, so each
131-
project’s dependencies have their own package scopes. A `package.json` lacking a
132-
`"type"` field is treated as if it contained `"type": "commonjs"`.
131+
project’s dependencies have their own package scopes. If a `package.json` file
132+
does not have a `"type"` field, the default `"type"` is `"commonjs"`.
133133

134134
The package scope applies not only to initial entry points (`node my-app.js`)
135135
but also to files referenced by `import` statements and `import()` expressions.

0 commit comments

Comments
 (0)