execArgv
The process.execArgv
property returns the set of Node.js-specific command-line options passed when the Node.js process was launched. These options do not appear in the array returned by the {@link argv} property, and do not include the Node.js executable, the name of the script, or any options following the script name. These options are useful in order to spawn child processes with the same execution environment as the parent.
node --icu-data-dir=./foo --require ./bar.js script.js --version
Content copied to clipboard
Results in process.execArgv
:
["--icu-data-dir=./foo", "--require", "./bar.js"]
Content copied to clipboard
And process.argv
:
['/usr/local/bin/node', 'script.js', '--version']
Content copied to clipboard
Refer to Worker constructor
for the detailed behavior of worker threads with this property.
Since
v0.7.7