diff --git a/doc/api/process.md b/doc/api/process.md index 5718c83e4fbcf4..3e54579cca210c 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -958,6 +958,32 @@ $ bash -c 'exec -a customArgv0 ./node' 'customArgv0' ``` +## `process.argv1` + + + +* {string | undefined} + +The `process.argv1` property stores a read-only copy of the original value of +`argv[1]` passed when Node.js starts. + +```js +// test.js +console.log('argv1 ', process.argv1); +console.log('argv[1]', process.argv[1]); +``` + +```shell +$ node ./test.js +argv1 ./test.js +argv[1] /Users/geoffrey/Sites/node/test.js +``` + +`process.argv1` is `undefined` for cases where Node is run without a main entry +point, such as `node --eval`. + ## `process.channel`