@@ -69,13 +69,14 @@ expressions:
6969* Strings passed in as an argument to ` --eval ` , or piped to ` node ` via ` STDIN ` ,
7070 with the flag ` --input-type=module ` .
7171
72- * Code that contains syntax that only parses successfully as [ ES modules] [ ] ,
73- such as ` import ` or ` export ` statements or ` import.meta ` , when the code has no
74- explicit marker of how it should be interpreted. Explicit markers are ` .mjs `
75- or ` .cjs ` extensions, ` package.json ` ` "type" ` fields with either ` "module" ` or
76- ` "commonjs" ` values, or ` --input-type ` or ` --experimental-default-type ` flags.
77- Dynamic ` import() ` expressions are supported in either CommonJS or ES modules
78- and would not cause a file to be treated as an ES module.
72+ * When using [ ` --experimental-detect-module ` ] [ ] , code containing syntax only
73+ successfully parsed as [ ES modules] [ ] , such as ` import ` or ` export `
74+ statements or ` import.meta ` , having no explicit marker of how it should be
75+ interpreted. Explicit markers are ` .mjs ` or ` .cjs ` extensions, ` package.json `
76+ ` "type" ` fields with either ` "module" ` or ` "commonjs" ` values, or
77+ ` --input-type ` or ` --experimental-default-type ` flags. Dynamic ` import() `
78+ expressions are supported in either CommonJS or ES modules and would not
79+ cause a file to be treated as an ES module.
7980
8081Node.js will treat the following as [ CommonJS] [ ] when passed to ` node ` as the
8182initial input, or when referenced by ` import ` statements or ` import() `
@@ -1362,6 +1363,7 @@ This field defines [subpath imports][] for the current package.
13621363[ `"type"` ] : #type
13631364[ `--conditions` / `-C` flag ] : #resolving-user-conditions
13641365[ `--experimental-default-type` ] : cli.md#--experimental-default-typetype
1366+ [ `--experimental-detect-module` ] : cli.md#--experimental-detect-module
13651367[ `--no-addons` flag ] : cli.md#--no-addons
13661368[ `ERR_PACKAGE_PATH_NOT_EXPORTED` ] : errors.md#err_package_path_not_exported
13671369[ `esm` ] : https://github.com/standard-things/esm#readme
0 commit comments