@@ -102,17 +102,18 @@ There is the CommonJS module loader:
102102 ` process.dlopen() ` .
103103* It treats all files that lack ` .json ` or ` .node ` extensions as JavaScript
104104 text files.
105- * It cannot be used to load ECMAScript modules. Attempting to do so will result
106- in a [ ` ERR_REQUIRE_ESM ` ] [ ] error. When used to load a JavaScript text file
107- that is not an ECMAScript module, it loads it as a CommonJS module.
105+ * It cannot be used to load ECMAScript modules (although it is possible to
106+ [ load ECMASCript modules from CommonJS modules] [ ] ). When used to load a
107+ JavaScript text file that is not an ECMAScript module, it loads it as a
108+ CommonJS module.
108109
109110There is the ECMAScript module loader:
110111
111112* It is asynchronous.
112113* It is responsible for handling ` import ` statements and ` import() ` expressions.
113114* It is not monkey patchable, can be customized using [ loader hooks] [ ] .
114- * No extension searching, a file extension must be provided when the specifier
115- is a relative or absolute file URL.
115+ * It does no extension searching. A file extension must be provided
116+ when the specifier is a relative or absolute file URL.
116117* It does not support folders as modules, directory indexes (e.g.
117118 ` './startup/index.js' ` ) must be fully specified.
118119* It can load JSON modules, but an import assertion is required (behind
@@ -1275,11 +1276,11 @@ This field defines [subpath imports][] for the current package.
12751276[ `--conditions` / `-C` flag ] : #resolving-user-conditions
12761277[ `--no-addons` flag ] : cli.md#--no-addons
12771278[ `ERR_PACKAGE_PATH_NOT_EXPORTED` ] : errors.md#err_package_path_not_exported
1278- [ `ERR_REQUIRE_ESM` ] : errors.md#err_require_esm
12791279[ `esm` ] : https://github.com/standard-things/esm#readme
12801280[ `package.json` ] : #nodejs-packagejson-field-definitions
12811281[ entry points ] : #package-entry-points
12821282[ folders as modules ] : modules.md#folders-as-modules
1283+ [ load ECMASCript modules from CommonJS modules ] : modules.md#the-mjs-extension
12831284[ loader hooks ] : esm.md#loaders
12841285[ self-reference ] : #self-referencing-a-package-using-its-name
12851286[ subpath exports ] : #subpath-exports
0 commit comments