@@ -911,6 +911,69 @@ added: v23.6.0
911
911
912
912
Enable experimental import support for ` .node ` addons.
913
913
914
+ ### ` --experimental-config-file `
915
+
916
+ <!-- YAML
917
+ added: REPLACEME
918
+ -->
919
+
920
+ > Stability: 1.0 - Early development
921
+
922
+ Use this flag to specify a configuration file that will be loaded and parsed
923
+ before the application starts.
924
+ Node.js will read the configuration file and apply the settings.
925
+ The configuration file should be a JSON file
926
+ with the following structure:
927
+
928
+ ``` json
929
+ {
930
+ "$schema" : " https://nodejs.org/dist/REPLACEME/docs/node_config_json_schema.json" ,
931
+ "experimental-transform-types" : true ,
932
+ "import" : [
933
+ " amaro/transform"
934
+ ],
935
+ "disable-warning" : " ExperimentalWarning" ,
936
+ "watch-path" : " src" ,
937
+ "watch-preserve-output" : true
938
+ }
939
+ ```
940
+
941
+ Only flags that are allowed in [ ` NODE_OPTIONS ` ] [ ] are supported.
942
+ No-op flags are not supported.
943
+ Not all V8 flags are currently supported.
944
+
945
+ It is possible to use the [ official JSON schema] ( ../node_config_json_schema.json )
946
+ to validate the configuration file, which may vary depending on the Node.js version.
947
+ Each key in the configuration file corresponds to a flag that can be passed
948
+ as a command-line argument. The value of the key is the value that would be
949
+ passed to the flag.
950
+
951
+ For example, the configuration file above is equivalent to
952
+ the following command-line arguments:
953
+
954
+ ``` bash
955
+ node --experimental-transform-types --import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output
956
+ ```
957
+
958
+ The priority in configuration is as follows:
959
+
960
+ 1 . NODE\_ OPTIONS and command-line options
961
+ 2 . Configuration file
962
+ 3 . Dotenv NODE\_ OPTIONS
963
+
964
+ Values in the configuration file will not override the values in the environment
965
+ variables and command-line options, but will override the values in the ` NODE_OPTIONS `
966
+ env file parsed by the ` --env-file ` flag.
967
+
968
+ If duplicate keys are present in the configuration file, only
969
+ the first key will be used.
970
+
971
+ The configuration parser will throw an error if the configuration file contains
972
+ unknown keys or keys that cannot used in ` NODE_OPTIONS ` .
973
+
974
+ Node.js will not sanitize or perform validation on the user-provided configuration,
975
+ so ** NEVER** use untrusted configuration files.
976
+
914
977
### ` --experimental-eventsource `
915
978
916
979
<!-- YAML
0 commit comments