module: correct docs about when extensionless files are supported
PR-URL: https://github.com/nodejs/node/pull/31415 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
04d07ed3ab
commit
811aa5c71f
@ -33,9 +33,9 @@ initial input, or when referenced by `import` statements within ES module code:
|
||||
|
||||
* Files ending in `.mjs`.
|
||||
|
||||
* Files ending in `.js`, or extensionless files, when the nearest parent
|
||||
`package.json` file contains a top-level field `"type"` with a value of
|
||||
`"module"`.
|
||||
* Files ending in `.js`, or extensionless files when run as main entry points on
|
||||
the command line, when the nearest parent `package.json` file contains a
|
||||
top-level field `"type"` with a value of `"module"`.
|
||||
|
||||
* Strings passed in as an argument to `--eval` or `--print`, or piped to
|
||||
`node` via `STDIN`, with the flag `--input-type=module`.
|
||||
@ -50,9 +50,9 @@ or when referenced by `import` statements within ES module code:
|
||||
|
||||
* Files ending in `.cjs`.
|
||||
|
||||
* Files ending in `.js`, or extensionless files, when the nearest parent
|
||||
`package.json` file contains a top-level field `"type"` with a value of
|
||||
`"commonjs"`.
|
||||
* Files ending in `.js`, or extensionless files when run as main entry points on
|
||||
the command line, when the nearest parent `package.json` file contains a
|
||||
top-level field `"type"` with a value of `"commonjs"`.
|
||||
|
||||
* Strings passed in as an argument to `--eval` or `--print`, or piped to
|
||||
`node` via `STDIN`, with the flag `--input-type=commonjs`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user