@@ -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
@@ -896,38 +893,6 @@ and `"` are usable.
896893It is possible to run code containing inline types by passing
897894[ ` --experimental-strip-types ` ] [ ] .
898895
899- ### ` --experimental-default-type=type `
900-
901- <!-- YAML
902- added:
903- - v21.0.0
904- - v20.10.0
905- - v18.19.0
906- -->
907-
908- > Stability: 1.0 - Early development
909-
910- Define which module system, ` module ` or ` commonjs ` , to use for the following:
911-
912- * String input provided via ` --eval ` or STDIN, if ` --input-type ` is unspecified.
913-
914- * Files ending in ` .js ` or with no extension, if there is no ` package.json ` file
915- present in the same folder or any parent folder.
916-
917- * Files ending in ` .js ` or with no extension, if the nearest parent
918- ` package.json ` field lacks a ` "type" ` field; unless the ` package.json ` folder
919- or any parent folder is inside a ` node_modules ` folder.
920-
921- In other words, ` --experimental-default-type=module ` flips all the places where
922- Node.js currently defaults to CommonJS to instead default to ECMAScript modules,
923- with the exception of folders and subfolders below ` node_modules ` , for backward
924- compatibility.
925-
926- Under ` --experimental-default-type=module ` and ` --experimental-wasm-modules ` ,
927- files with no extension will be treated as WebAssembly if they begin with the
928- WebAssembly magic number (` \0asm ` ); otherwise they will be treated as ES module
929- JavaScript.
930-
931896### ` --experimental-transform-types `
932897
933898<!-- YAML
@@ -1404,7 +1369,7 @@ added: v12.0.0
14041369
14051370This configures Node.js to interpret ` --eval ` or ` STDIN ` input as CommonJS or
14061371as an ES module. Valid values are ` "commonjs" ` or ` "module" ` . The default is
1407- ` "commonjs" ` unless [ ` --experimental-default-type=module ` ] [ ] is used .
1372+ ` "commonjs" ` .
14081373
14091374The REPL does not support this option. Usage of ` --input-type=module ` with
14101375[ ` --print ` ] [ ] will throw an error, as ` --print ` does not support ES module
@@ -3057,7 +3022,6 @@ one is included in the list below.
30573022* ` --enable-source-maps `
30583023* ` --entry-url `
30593024* ` --experimental-abortcontroller `
3060- * ` --experimental-default-type `
30613025* ` --experimental-detect-module `
30623026* ` --experimental-eventsource `
30633027* ` --experimental-import-meta-resolve `
@@ -3620,7 +3584,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
36203584[ `--diagnostic-dir` ] : #--diagnostic-dirdirectory
36213585[ `--env-file-if-exists` ] : #--env-file-if-existsconfig
36223586[ `--env-file` ] : #--env-fileconfig
3623- [ `--experimental-default-type=module` ] : #--experimental-default-typetype
36243587[ `--experimental-sea-config` ] : single-executable-applications.md#generating-single-executable-preparation-blobs
36253588[ `--experimental-strip-types` ] : #--experimental-strip-types
36263589[ `--experimental-wasm-modules` ] : #--experimental-wasm-modules
0 commit comments