Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup!
  • Loading branch information
aduh95 committed Jan 14, 2022
commit fe05b7283fcb1c2037bc962cddf66e492371a0a3
9 changes: 5 additions & 4 deletions doc/api/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ There is the CommonJS module loader:
* It is fully synchronous.
* It is responsible for handling `require()` calls.
* It is monkey patchable.
* When resolving a specifier, if no exact match is found, it will try to add
extensions (`.js`, `.json`, and finally `.node`).
* It supports [folders as modules][].
* When resolving a specifier, if no exact match is found, it will try to add
extensions (`.js`, `.json`, and finally `.node`) and then attempt to resolve
[folders as modules][].
* It treats `.json` as JSON text files.
Comment thread
GeoffreyBooth marked this conversation as resolved.
* `.node` files are interpreted as compiled addon modules loaded with
`process.dlopen()`.
Expand All @@ -112,10 +113,10 @@ There is the ECMAScript module loader:
* It is asynchronous.
* It is responsible for handling `import` statements and `import()` expressions.
* It is not monkey patchable, can be customized using [loader hooks][].
* It does no extension searching. A file extension must be provided
when the specifier is a relative or absolute file URL.
* It does not support folders as modules, directory indexes (e.g.
`'./startup/index.js'`) must be fully specified.
* It does no extension searching. A file extension must be provided
when the specifier is a relative or absolute file URL.
* It can load JSON modules, but an import assertion is required (behind
`--experimental-json-modules` flag).
* It accepts only `.js`, `.mjs`, and `.cjs` extensions for JavaScript text
Expand Down