Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ By default, Node.js will treat the following as CommonJS modules:

* Files with an extension that is not `.mjs`, `.cjs`, `.json`, `.node`, or `.js`
(when the nearest parent `package.json` file contains a top-level field
[`"type"`][] with a value of `"module"`, those files will be recognized as
CommonJS modules only if they are being included via `require()`, not when
used as the command-line entry point of the program).
[`"type"`][] with a value of `"module"`, those files will not be recognized as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just removed this entire point, because the opening paragraph says:

Node.js will treat the following as CommonJS modules

Instead, just add a new paragraph noting that files with extensions outside that set/files without extensions would be treated based on the type field in the package.json

CommonJS modules).

See [Determining module system][] for more details.

Expand Down
Loading