@@ -919,8 +919,13 @@ added: REPLACEME
919919
920920> Stability: 1.0 - Early development
921921
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+
924929Node.js will read the configuration file and apply the settings.
925930The configuration file should be a JSON file
926931with the following structure:
@@ -929,11 +934,9 @@ with the following structure:
929934{
930935 "$schema" : " https://nodejs.org/dist/REPLACEME/docs/node_config_json_schema.json" ,
931936 "nodeOptions" : {
932- "experimental-transform-types" : true ,
933937 "import" : [
934938 " amaro/transform"
935939 ],
936- "disable-warning" : " ExperimentalWarning" ,
937940 "watch-path" : " src" ,
938941 "watch-preserve-output" : true
939942 }
@@ -944,7 +947,7 @@ In the `nodeOptions` field, only flags that are allowed in [`NODE_OPTIONS`][] ar
944947No-op flags are not supported.
945948Not all V8 flags are currently supported.
946949
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 )
948951to validate the configuration file, which may vary depending on the Node.js version.
949952Each key in the configuration file corresponds to a flag that can be passed
950953as 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
954957the following command-line arguments:
955958
956959``` bash
957- node --experimental-transform-types -- import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output
960+ node --import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output
958961```
959962
960963The priority in configuration is as follows:
@@ -976,6 +979,22 @@ unknown keys or keys that cannot used in `NODE_OPTIONS`.
976979Node.js will not sanitize or perform validation on the user-provided configuration,
977980so ** NEVER** use untrusted configuration files.
978981
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+
979998### ` --experimental-eventsource `
980999
9811000<!-- YAML
@@ -3833,6 +3852,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
38333852[ `--env-file-if-exists` ] : #--env-file-if-existsconfig
38343853[ `--env-file` ] : #--env-fileconfig
38353854[ `--experimental-addon-modules` ] : #--experimental-addon-modules
3855+ [ `--experimental-config-file-path` ] : #--experimental-config-file-path
38363856[ `--experimental-sea-config` ] : single-executable-applications.md#generating-single-executable-preparation-blobs
38373857[ `--experimental-wasm-modules` ] : #--experimental-wasm-modules
38383858[ `--heap-prof-dir` ] : #--heap-prof-dir
0 commit comments