@@ -909,61 +909,30 @@ flows within the application. As such, it is presently recommended to be sure
909
909
your application behaviour is unaffected by this change before using it in
910
910
production.
911
911
912
- ### ` --experimental-default-type=type `
913
-
914
- <!-- YAML
915
- added:
916
- - v21.0.0
917
- - v20.10.0
918
- - v18.19.0
919
- -->
920
-
921
- > Stability: 1.0 - Early development
922
-
923
- Define which module system, ` module ` or ` commonjs ` , to use for the following:
924
-
925
- * String input provided via ` --eval ` or STDIN, if ` --input-type ` is unspecified.
926
-
927
- * Files ending in ` .js ` or with no extension, if there is no ` package.json ` file
928
- present in the same folder or any parent folder.
929
-
930
- * Files ending in ` .js ` or with no extension, if the nearest parent
931
- ` package.json ` field lacks a ` "type" ` field; unless the ` package.json ` folder
932
- or any parent folder is inside a ` node_modules ` folder.
933
-
934
- In other words, ` --experimental-default-type=module ` flips all the places where
935
- Node.js currently defaults to CommonJS to instead default to ECMAScript modules,
936
- with the exception of folders and subfolders below ` node_modules ` , for backward
937
- compatibility.
938
-
939
- Under ` --experimental-default-type=module ` and ` --experimental-wasm-modules ` ,
940
- files with no extension will be treated as WebAssembly if they begin with the
941
- WebAssembly magic number (` \0asm ` ); otherwise they will be treated as ES module
942
- JavaScript.
943
-
944
- ### ` --experimental-config-file `
912
+ ### ` --experimental-config-file=config `
945
913
946
914
<!-- YAML
947
915
added: REPLACEME
948
916
-->
949
917
950
918
> Stability: 1.0 - Early development
951
919
952
- Use this flag to specify a configuration file that will be loaded and parsed
953
- before the application starts .
920
+ If present, Node.js will look for a
921
+ configuration file at the specified path .
954
922
Node.js will read the configuration file and apply the settings.
955
923
The configuration file should be a JSON file
956
924
with the following structure:
957
925
926
+ > \[ !NOTE]
927
+ > Replace ` vX.Y.Z ` in the ` $schema ` with the version of Node.js you are using.
928
+
958
929
``` json
959
930
{
960
- "$schema" : " https://nodejs.org/dist/REPLACEME /docs/node_config_json_schema .json" ,
931
+ "$schema" : " https://nodejs.org/dist/vX.Y.Z /docs/node-config-schema .json" ,
961
932
"nodeOptions" : {
962
- "experimental-transform-types" : true ,
963
933
"import" : [
964
- " amaro/transform "
934
+ " amaro/strip "
965
935
],
966
- "disable-warning" : " ExperimentalWarning" ,
967
936
"watch-path" : " src" ,
968
937
"watch-preserve-output" : true
969
938
}
@@ -974,7 +943,7 @@ In the `nodeOptions` field, only flags that are allowed in [`NODE_OPTIONS`][] ar
974
943
No-op flags are not supported.
975
944
Not all V8 flags are currently supported.
976
945
977
- It is possible to use the [ official JSON schema] ( ../node_config_json_schema .json )
946
+ It is possible to use the [ official JSON schema] ( ../node-config-schema .json )
978
947
to validate the configuration file, which may vary depending on the Node.js version.
979
948
Each key in the configuration file corresponds to a flag that can be passed
980
949
as a command-line argument. The value of the key is the value that would be
@@ -984,7 +953,7 @@ For example, the configuration file above is equivalent to
984
953
the following command-line arguments:
985
954
986
955
``` bash
987
- node --experimental-transform-types -- import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output
956
+ node --import amaro/strip --watch-path=src --watch-preserve-output
988
957
```
989
958
990
959
The priority in configuration is as follows:
@@ -1006,6 +975,50 @@ unknown keys or keys that cannot used in `NODE_OPTIONS`.
1006
975
Node.js will not sanitize or perform validation on the user-provided configuration,
1007
976
so ** NEVER** use untrusted configuration files.
1008
977
978
+ ### ` --experimental-default-config-file `
979
+
980
+ <!-- YAML
981
+ added: REPLACEME
982
+ -->
983
+
984
+ > Stability: 1.0 - Early development
985
+
986
+ If the ` --experimental-default-config-file ` flag is present, Node.js will look for a
987
+ ` node.config.json ` file in the current working directory and load it as a
988
+ as configuration file.
989
+
990
+ ### ` --experimental-default-type=type `
991
+
992
+ <!-- YAML
993
+ added:
994
+ - v21.0.0
995
+ - v20.10.0
996
+ - v18.19.0
997
+ -->
998
+
999
+ > Stability: 1.0 - Early development
1000
+
1001
+ Define which module system, ` module ` or ` commonjs ` , to use for the following:
1002
+
1003
+ * String input provided via ` --eval ` or STDIN, if ` --input-type ` is unspecified.
1004
+
1005
+ * Files ending in ` .js ` or with no extension, if there is no ` package.json ` file
1006
+ present in the same folder or any parent folder.
1007
+
1008
+ * Files ending in ` .js ` or with no extension, if the nearest parent
1009
+ ` package.json ` field lacks a ` "type" ` field; unless the ` package.json ` folder
1010
+ or any parent folder is inside a ` node_modules ` folder.
1011
+
1012
+ In other words, ` --experimental-default-type=module ` flips all the places where
1013
+ Node.js currently defaults to CommonJS to instead default to ECMAScript modules,
1014
+ with the exception of folders and subfolders below ` node_modules ` , for backward
1015
+ compatibility.
1016
+
1017
+ Under ` --experimental-default-type=module ` and ` --experimental-wasm-modules ` ,
1018
+ files with no extension will be treated as WebAssembly if they begin with the
1019
+ WebAssembly magic number (` \0asm ` ); otherwise they will be treated as ES module
1020
+ JavaScript.
1021
+
1009
1022
### ` --experimental-eventsource `
1010
1023
1011
1024
<!-- YAML
0 commit comments