Skip to content

Commit ca81af7

Browse files
GeoffreyBoothcodebytere
authored andcommitted
module: correct docs about when extensionless files are supported
PR-URL: #31415 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 6797656 commit ca81af7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/api/esm.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ initial input, or when referenced by `import` statements within ES module code:
3333

3434
* Files ending in `.mjs`.
3535

36-
* Files ending in `.js`, or extensionless files, when the nearest parent
37-
`package.json` file contains a top-level field `"type"` with a value of
38-
`"module"`.
36+
* Files ending in `.js`, or extensionless files when run as main entry points on
37+
the command line, when the nearest parent `package.json` file contains a
38+
top-level field `"type"` with a value of `"module"`.
3939

4040
* Strings passed in as an argument to `--eval` or `--print`, or piped to
4141
`node` via `STDIN`, with the flag `--input-type=module`.
@@ -50,9 +50,9 @@ or when referenced by `import` statements within ES module code:
5050

5151
* Files ending in `.cjs`.
5252

53-
* Files ending in `.js`, or extensionless files, when the nearest parent
54-
`package.json` file contains a top-level field `"type"` with a value of
55-
`"commonjs"`.
53+
* Files ending in `.js`, or extensionless files when run as main entry points on
54+
the command line, when the nearest parent `package.json` file contains a
55+
top-level field `"type"` with a value of `"commonjs"`.
5656

5757
* Strings passed in as an argument to `--eval` or `--print`, or piped to
5858
`node` via `STDIN`, with the flag `--input-type=commonjs`.

0 commit comments

Comments
 (0)