diff --git a/doc/api/packages.md b/doc/api/packages.md index 9287ff71c404c9..8a5efdc89c4853 100644 --- a/doc/api/packages.md +++ b/doc/api/packages.md @@ -69,13 +69,14 @@ expressions: * Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`, with the flag `--input-type=module`. -* Code that contains syntax that only parses successfully as [ES modules][], - such as `import` or `export` statements or `import.meta`, when the code has no - explicit marker of how it should be interpreted. Explicit markers are `.mjs` - or `.cjs` extensions, `package.json` `"type"` fields with either `"module"` or - `"commonjs"` values, or `--input-type` or `--experimental-default-type` flags. - Dynamic `import()` expressions are supported in either CommonJS or ES modules - and would not cause a file to be treated as an ES module. +* When using [`--experimental-detect-module`][], code containing syntax only + successfully parsed as [ES modules][], such as `import` or `export` + statements or `import.meta`, having no explicit marker of how it should be + interpreted. Explicit markers are `.mjs` or `.cjs` extensions, `package.json` + `"type"` fields with either `"module"` or `"commonjs"` values, or + `--input-type` or `--experimental-default-type` flags. Dynamic `import()` + expressions are supported in either CommonJS or ES modules and would not + cause a file to be treated as an ES module. Node.js will treat the following as [CommonJS][] when passed to `node` as the initial input, or when referenced by `import` statements or `import()` @@ -1362,6 +1363,7 @@ This field defines [subpath imports][] for the current package. [`"type"`]: #type [`--conditions` / `-C` flag]: #resolving-user-conditions [`--experimental-default-type`]: cli.md#--experimental-default-typetype +[`--experimental-detect-module`]: cli.md#--experimental-detect-module [`--no-addons` flag]: cli.md#--no-addons [`ERR_PACKAGE_PATH_NOT_EXPORTED`]: errors.md#err_package_path_not_exported [`esm`]: https://github.com/standard-things/esm#readme