@@ -25,16 +25,14 @@ For more info about `node inspect`, see the [debugger][] documentation.
25
25
26
26
The program entry point is a specifier-like string. If the string is not an
27
27
absolute 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.
31
30
32
31
If a file is found, its path will be passed to the
33
32
[ ES module loader] [ Modules loaders ] under any of the following conditions:
34
33
35
34
* 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 ` .
38
36
* The file has an ` .mjs ` extension.
39
37
* The file does not have a ` .cjs ` extension, and the nearest parent
40
38
` 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
47
45
48
46
When loading, the [ ES module loader] [ Modules loaders ] loads the program
49
47
entry 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.
53
50
54
51
## Options
55
52
@@ -910,38 +907,6 @@ flows within the application. As such, it is presently recommended to be sure
910
907
your application behaviour is unaffected by this change before using it in
911
908
production.
912
909
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
-
945
910
### ` --experimental-transform-types `
946
911
947
912
<!-- YAML
@@ -1418,7 +1383,7 @@ added: v12.0.0
1418
1383
1419
1384
This configures Node.js to interpret ` --eval ` or ` STDIN ` input as CommonJS or
1420
1385
as an ES module. Valid values are ` "commonjs" ` or ` "module" ` . The default is
1421
- ` "commonjs" ` unless [ ` --experimental-default-type=module ` ] [ ] is used .
1386
+ ` "commonjs" ` .
1422
1387
1423
1388
The REPL does not support this option. Usage of ` --input-type=module ` with
1424
1389
[ ` --print ` ] [ ] will throw an error, as ` --print ` does not support ES module
@@ -3059,7 +3024,6 @@ one is included in the list below.
3059
3024
* ` --entry-url `
3060
3025
* ` --experimental-abortcontroller `
3061
3026
* ` --experimental-async-context-frame `
3062
- * ` --experimental-default-type `
3063
3027
* ` --experimental-detect-module `
3064
3028
* ` --experimental-eventsource `
3065
3029
* ` --experimental-import-meta-resolve `
@@ -3621,7 +3585,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
3621
3585
[ `--diagnostic-dir` ] : #--diagnostic-dirdirectory
3622
3586
[ `--env-file-if-exists` ] : #--env-file-if-existsconfig
3623
3587
[ `--env-file` ] : #--env-fileconfig
3624
- [ `--experimental-default-type=module` ] : #--experimental-default-typetype
3625
3588
[ `--experimental-sea-config` ] : single-executable-applications.md#generating-single-executable-preparation-blobs
3626
3589
[ `--experimental-strip-types` ] : #--experimental-strip-types
3627
3590
[ `--experimental-wasm-modules` ] : #--experimental-wasm-modules
0 commit comments