process: add allowedNodeEnvironmentFlags property
process.allowedNodeEnvironmentFlags
lists all allowable flags within the NODE_OPTIONS
environment variable.
UPDATE Aug 17 2018: I've modified this PR to provide a friendlier API, as described in this comment.
This change addresses #17740 (closed) as far as I need it to. The whitelist of NODE_OPTIONS
-able flags (not counting v8 flags) correspond to the set of flags a CLI application may want to pass along to a spawned node
process. Put another way, other Node.js-specific flags are essentially useless to CLI apps wrapping node
.
- I changed
whitelist
to be more obvious about what it's for, since it's no longer within a function. - I also changed
whitelist
to a vector to mimic the existing global static variables innode.cc
(I didn't see aconst char * []
anywhere; don't know if this matters) - Added a test
- Added documentation
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines