@@ -911,6 +911,77 @@ 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
+ "experimental" : {
931
+ "transform_types" : true
932
+ },
933
+ "import" : [
934
+ " amaro/transform"
935
+ ],
936
+ "test" : {
937
+ "only" : true
938
+ }
939
+ }
940
+ ```
941
+
942
+ Each key in the configuration file corresponds to a flag that can be passed
943
+ as a command-line argument. The value of the key is the value that would be
944
+ passed to the flag.
945
+
946
+ For example, the configuration file above is equivalent to
947
+ the following command-line arguments:
948
+
949
+ ``` bash
950
+ node --experimental-transform-types --import amaro/transform
951
+ ```
952
+
953
+ The priority in configuration is as follows:
954
+
955
+ * NODE\_ OPTIONS and command-line options
956
+ * Config file
957
+ * Dotenv NODE\_ OPTIONS
958
+
959
+ If multiple keys are present in the configuration file,
960
+ the last one will override the previous ones.
961
+ Unknown keys will be ignored.
962
+
963
+ It possible to use the official json schema to validate the configuration file,
964
+ which may vary depending on the Node.js version.
965
+
966
+ ``` json
967
+ {
968
+ "$schema" : " https://nodejs.org/dist/REPLACEME/docs/node_config_json_schema.json" ,
969
+ }
970
+ ```
971
+
972
+ Node.js will not sanitize or perform validation on the user-provided configuration,
973
+ so ** NEVER** use untrusted configuration files.
974
+ In the example below ` --some-other-flag `
975
+ will not be sanitized and will be passed to the Node.js process.
976
+
977
+ ``` json
978
+ {
979
+ "import" : [
980
+ " amaro/transform --some-other-flag"
981
+ ],
982
+ }
983
+ ```
984
+
914
985
### ` --experimental-eventsource `
915
986
916
987
<!-- YAML
0 commit comments