diff --git a/doc/api/cli.md b/doc/api/cli.md index 9492aa2204dd6b..2d07e49eb2a844 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -25,16 +25,14 @@ For more info about `node inspect`, see the [debugger][] documentation. The program entry point is a specifier-like string. If the string is not an absolute path, it's resolved as a relative path from the current working -directory. That path is then resolved by [CommonJS][] module loader, or by the -[ES module loader][Modules loaders] if [`--experimental-default-type=module`][] -is passed. If no corresponding file is found, an error is thrown. +directory. That path is then resolved by [CommonJS][] module loader. If no +corresponding file is found, an error is thrown. If a file is found, its path will be passed to the [ES module loader][Modules loaders] under any of the following conditions: * The program was started with a command-line flag that forces the entry - point to be loaded with ECMAScript module loader, such as `--import` or - [`--experimental-default-type=module`][]. + point to be loaded with ECMAScript module loader, such as `--import`. * The file has an `.mjs` extension. * The file does not have a `.cjs` extension, and the nearest parent `package.json` file contains a top-level [`"type"`][] field with a value of @@ -47,9 +45,8 @@ Otherwise, the file is loaded using the CommonJS module loader. See When loading, the [ES module loader][Modules loaders] loads the program entry point, the `node` command will accept as input only files with `.js`, -`.mjs`, or `.cjs` extensions; with `.wasm` extensions when -[`--experimental-wasm-modules`][] is enabled; and with no extension when -[`--experimental-default-type=module`][] is passed. +`.mjs`, or `.cjs` extensions; and with `.wasm` extensions when +[`--experimental-wasm-modules`][] is enabled. ## Options @@ -896,38 +893,6 @@ and `"` are usable. It is possible to run code containing inline types by passing [`--experimental-strip-types`][]. -### `--experimental-default-type=type` - - - -> Stability: 1.0 - Early development - -Define which module system, `module` or `commonjs`, to use for the following: - -* String input provided via `--eval` or STDIN, if `--input-type` is unspecified. - -* Files ending in `.js` or with no extension, if there is no `package.json` file - present in the same folder or any parent folder. - -* Files ending in `.js` or with no extension, if the nearest parent - `package.json` field lacks a `"type"` field; unless the `package.json` folder - or any parent folder is inside a `node_modules` folder. - -In other words, `--experimental-default-type=module` flips all the places where -Node.js currently defaults to CommonJS to instead default to ECMAScript modules, -with the exception of folders and subfolders below `node_modules`, for backward -compatibility. - -Under `--experimental-default-type=module` and `--experimental-wasm-modules`, -files with no extension will be treated as WebAssembly if they begin with the -WebAssembly magic number (`\0asm`); otherwise they will be treated as ES module -JavaScript. - ### `--experimental-transform-types`