Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation of process.argv[0] #7449

Closed
wants to merge 7 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ added: v0.1.27

The `process.argv` property returns a array containing the command line
arguments passed when the Node.js process was launched. The first element will
be 'node', the second element will be the name of the JavaScript file. The
remaining elements will be any additional command line arguments.
be [`process.execPath()`], second element will be the path to JavaScript file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the part about the second element should be a separate sentence:

The second element will be the path to the JavaScript file being executed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

I think the part about the second element should be a separate sentence:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it's still one sentence, just with 'the' removed in two places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry forgot to push changes.

The remaining elements will be any additional command line arguments.

For example, assuming the following script for `process-args.js`:

Expand All @@ -473,7 +473,7 @@ $ node process-2.js one two=three four
Would generate the output:

```text
0: node
0: /usr/local/bin/node
1: /Users/mjr/work/node/process-2.js
2: one
3: two=three
Expand Down Expand Up @@ -1663,6 +1663,7 @@ cases:
[`process.argv`]: #process_process_argv
[`process.exit()`]: #process_process_exit_code
[`process.kill()`]: #process_process_kill_pid_signal
[`process.execPath()`]: #process_process_execPath
[`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
[`require.main`]: modules.html#modules_accessing_the_main_module
[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_arg
Expand Down