@@ -919,21 +919,24 @@ added: REPLACEME
919
919
920
920
> Stability: 1.0 - Early development
921
921
922
- Use this flag to specify a configuration file that will be loaded and parsed
923
- before the application starts.
922
+ If the ` --experimental-config-file ` flag is present, Node.js will look for a
923
+ ` node.config.json ` file in the current working directory and load it as a
924
+ as configuration file.
925
+
926
+ If [ ` --experimental-config-file-path ` ] [ ] is present, Node.js will look for a
927
+ configuration file at the specified path.
928
+
924
929
Node.js will read the configuration file and apply the settings.
925
930
The configuration file should be a JSON file
926
931
with the following structure:
927
932
928
933
``` json
929
934
{
930
- "$schema" : " https://nodejs.org/dist/REPLACEME/docs/node_config_json_schema .json" ,
935
+ "$schema" : " https://nodejs.org/dist/REPLACEME/docs/node-config-schema .json" ,
931
936
"nodeOptions" : {
932
- "experimental-transform-types" : true ,
933
937
"import" : [
934
- " amaro/transform "
938
+ " amaro/strip "
935
939
],
936
- "disable-warning" : " ExperimentalWarning" ,
937
940
"watch-path" : " src" ,
938
941
"watch-preserve-output" : true
939
942
}
@@ -944,7 +947,7 @@ In the `nodeOptions` field, only flags that are allowed in [`NODE_OPTIONS`][] ar
944
947
No-op flags are not supported.
945
948
Not all V8 flags are currently supported.
946
949
947
- It is possible to use the [ official JSON schema] ( ../node_config_json_schema .json )
950
+ It is possible to use the [ official JSON schema] ( ../node-config-schema .json )
948
951
to validate the configuration file, which may vary depending on the Node.js version.
949
952
Each key in the configuration file corresponds to a flag that can be passed
950
953
as a command-line argument. The value of the key is the value that would be
@@ -954,7 +957,7 @@ For example, the configuration file above is equivalent to
954
957
the following command-line arguments:
955
958
956
959
``` bash
957
- node --experimental-transform-types -- import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output
960
+ node --import amaro/strip --watch-path=src --watch-preserve-output
958
961
```
959
962
960
963
The priority in configuration is as follows:
@@ -976,6 +979,22 @@ unknown keys or keys that cannot used in `NODE_OPTIONS`.
976
979
Node.js will not sanitize or perform validation on the user-provided configuration,
977
980
so ** NEVER** use untrusted configuration files.
978
981
982
+ ### ` --experimental-config-file-path `
983
+
984
+ <!-- YAML
985
+ added: REPLACEME
986
+ -->
987
+
988
+ > Stability: 1.0 - Early development
989
+
990
+ Use this flag to specify the path to the configuration file that will be loaded
991
+ and parsed before the application starts.
992
+ Example:
993
+
994
+ ``` bash
995
+ node --experimental-config-file-path=/path/to/config.json index.js
996
+ ```
997
+
979
998
### ` --experimental-eventsource `
980
999
981
1000
<!-- YAML
@@ -3833,6 +3852,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
3833
3852
[ `--env-file-if-exists` ] : #--env-file-if-existsconfig
3834
3853
[ `--env-file` ] : #--env-fileconfig
3835
3854
[ `--experimental-addon-modules` ] : #--experimental-addon-modules
3855
+ [ `--experimental-config-file-path` ] : #--experimental-config-file-path
3836
3856
[ `--experimental-sea-config` ] : single-executable-applications.md#generating-single-executable-preparation-blobs
3837
3857
[ `--experimental-wasm-modules` ] : #--experimental-wasm-modules
3838
3858
[ `--heap-prof-dir` ] : #--heap-prof-dir
0 commit comments