@@ -25,16 +25,14 @@ For more info about `node inspect`, see the [debugger][] documentation.
2525
2626The program entry point is a specifier-like string. If the string is not an
2727absolute path, it's resolved as a relative path from the current working
28- directory. That path is then resolved by [ CommonJS] [ ] module loader, or by the
29- [ ES module loader] [ Modules loaders ] if [ ` --experimental-default-type=module ` ] [ ]
30- is passed. If no corresponding file is found, an error is thrown.
28+ directory. That path is then resolved by [ CommonJS] [ ] module loader. If no
29+ corresponding file is found, an error is thrown.
3130
3231If a file is found, its path will be passed to the
3332[ ES module loader] [ Modules loaders ] under any of the following conditions:
3433
3534* The program was started with a command-line flag that forces the entry
36- point to be loaded with ECMAScript module loader, such as ` --import ` or
37- [ ` --experimental-default-type=module ` ] [ ] .
35+ point to be loaded with ECMAScript module loader, such as ` --import ` .
3836* The file has an ` .mjs ` extension.
3937* The file does not have a ` .cjs ` extension, and the nearest parent
4038 ` 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
4745
4846When loading, the [ ES module loader] [ Modules loaders ] loads the program
4947entry point, the ` node ` command will accept as input only files with ` .js ` ,
50- ` .mjs ` , or ` .cjs ` extensions; with ` .wasm ` extensions when
51- [ ` --experimental-wasm-modules ` ] [ ] is enabled; and with no extension when
52- [ ` --experimental-default-type=module ` ] [ ] is passed.
48+ ` .mjs ` , or ` .cjs ` extensions; and with ` .wasm ` extensions when
49+ [ ` --experimental-wasm-modules ` ] [ ] is enabled.
5350
5451## Options
5552
@@ -910,38 +907,6 @@ flows within the application. As such, it is presently recommended to be sure
910907your application behaviour is unaffected by this change before using it in
911908production.
912909
913- ### ` --experimental-default-type=type `
914-
915- <!-- YAML
916- added:
917- - v21.0.0
918- - v20.10.0
919- - v18.19.0
920- -->
921-
922- > Stability: 1.0 - Early development
923-
924- Define which module system, ` module ` or ` commonjs ` , to use for the following:
925-
926- * String input provided via ` --eval ` or STDIN, if ` --input-type ` is unspecified.
927-
928- * Files ending in ` .js ` or with no extension, if there is no ` package.json ` file
929- present in the same folder or any parent folder.
930-
931- * Files ending in ` .js ` or with no extension, if the nearest parent
932- ` package.json ` field lacks a ` "type" ` field; unless the ` package.json ` folder
933- or any parent folder is inside a ` node_modules ` folder.
934-
935- In other words, ` --experimental-default-type=module ` flips all the places where
936- Node.js currently defaults to CommonJS to instead default to ECMAScript modules,
937- with the exception of folders and subfolders below ` node_modules ` , for backward
938- compatibility.
939-
940- Under ` --experimental-default-type=module ` and ` --experimental-wasm-modules ` ,
941- files with no extension will be treated as WebAssembly if they begin with the
942- WebAssembly magic number (` \0asm ` ); otherwise they will be treated as ES module
943- JavaScript.
944-
945910### ` --experimental-transform-types `
946911
947912<!-- YAML
@@ -1418,7 +1383,7 @@ added: v12.0.0
14181383
14191384This configures Node.js to interpret ` --eval ` or ` STDIN ` input as CommonJS or
14201385as an ES module. Valid values are ` "commonjs" ` or ` "module" ` . The default is
1421- ` "commonjs" ` unless [ ` --experimental-default-type=module ` ] [ ] is used .
1386+ ` "commonjs" ` .
14221387
14231388The REPL does not support this option. Usage of ` --input-type=module ` with
14241389[ ` --print ` ] [ ] will throw an error, as ` --print ` does not support ES module
@@ -3059,7 +3024,6 @@ one is included in the list below.
30593024* ` --entry-url `
30603025* ` --experimental-abortcontroller `
30613026* ` --experimental-async-context-frame `
3062- * ` --experimental-default-type `
30633027* ` --experimental-detect-module `
30643028* ` --experimental-eventsource `
30653029* ` --experimental-import-meta-resolve `
@@ -3621,7 +3585,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
36213585[ `--diagnostic-dir` ] : #--diagnostic-dirdirectory
36223586[ `--env-file-if-exists` ] : #--env-file-if-existsconfig
36233587[ `--env-file` ] : #--env-fileconfig
3624- [ `--experimental-default-type=module` ] : #--experimental-default-typetype
36253588[ `--experimental-sea-config` ] : single-executable-applications.md#generating-single-executable-preparation-blobs
36263589[ `--experimental-strip-types` ] : #--experimental-strip-types
36273590[ `--experimental-wasm-modules` ] : #--experimental-wasm-modules
0 commit comments