@@ -950,16 +950,35 @@ When set to `1`, process warnings are silenced.
950
950
added: v8.0.0
951
951
-->
952
952
953
- A space-separated list of command line options. ` options... ` are interpreted as
954
- if they had been specified on the command line before the actual command line
955
- (so they can be overridden). Node.js will exit with an error if an option
956
- that is not allowed in the environment is used, such as ` -p ` or a script file.
953
+ A space-separated list of command line options. ` options... ` are interpreted
954
+ before command line options, so command line options will override or
955
+ compound after anything in ` options... ` . Node.js will exit with an error if
956
+ an option that is not allowed in the environment is used, such as ` -p ` or a
957
+ script file.
957
958
958
- In case an option value happens to contain a space (for example a path listed in
959
- ` --require ` ), it must be escaped using double quotes. For example:
959
+ In case an option value happens to contain a space (for example a path listed
960
+ in ` --require ` ), it must be escaped using double quotes. For example:
960
961
961
962
``` bash
962
- --require " ./my path/file.js"
963
+ NODE_OPTIONS=' --require "./my path/file.js"'
964
+ ```
965
+
966
+ A singleton flag passed as a command line option will override the same flag
967
+ passed into ` NODE_OPTIONS ` :
968
+
969
+ ``` bash
970
+ # The inspector will be available on port 5555
971
+ NODE_OPTIONS=' --inspect=localhost:4444' node --inspect=localhost:5555
972
+ ```
973
+
974
+ A flag that can be passed multiple times will be treated as if its
975
+ ` NODE_OPTIONS ` instances were passed first, and then its command line
976
+ instances afterwards:
977
+
978
+ ``` bash
979
+ NODE_OPTIONS=' --require "./a.js"' node --require " ./b.js"
980
+ # is equivalent to:
981
+ node --require " ./a.js" --require " ./b.js"
963
982
```
964
983
965
984
Node.js options that are allowed are:
0 commit comments