Skip to content
Closed
Changes from 1 commit
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
Next Next commit
Updated ReadMe for #7434
  • Loading branch information
tarungarg546 authored Jun 27, 2016
commit 7e8ab82723a9ff840bc21eaa79ef49ecc7094e24
3 changes: 2 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ 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
be [`process.execPath()`], the second element will be the name of the JavaScript file. The
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While we're in here, we may as well change "name of the JavaScript file" to something like "path to the JavaScript file."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Seems fair enough?
What say @cjihrig

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with @mscdex. Also, this line should be wrapped at 80 characters.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm. Is it a bug then that running a file named test.js using node test will lead to process.argv[1] === '/path/to/test', not /path/to/test.js?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmm.. that's an interesting question... but I think that's ok. While there is the potential for conflicts because of the missing .js, it's not likely to have a serious impact. I guess that someone could come along and create a separate file named test after the app was started that would lead to issues but that seems like a relatively safe edge case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done @cjihrig

remaining elements will be any additional command line arguments.

For example, assuming the following script for `process-args.js`:
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