| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c132e9c commit 63d361b
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -450,10 +450,11 @@ console.log(`This processor architecture is ${process.arch}`); | |||
| 450 | 450 | added: v0.1.27 | |
| 451 | 451 | --> | |
| 452 | 452 | ||
| 453 | - The `process.argv` property returns a array containing the command line | ||
| 453 | + The `process.argv` property returns an array containing the command line | ||
| 454 | 454 | arguments passed when the Node.js process was launched. The first element will | |
| 455 | - be 'node', the second element will be the name of the JavaScript file. The | ||
| 456 | - remaining elements will be any additional command line arguments. | ||
| 455 | + be [`process.execPath`]. The second element will be the path to the | ||
| 456 | + JavaScript file being executed. The remaining elements will be any additional | ||
| 457 | + command line arguments. | ||
| 457 | 458 | ||
| 458 | 459 | For example, assuming the following script for `process-args.js`: | |
| 459 | 460 | ||
@@ -473,7 +474,7 @@ $ node process-2.js one two=three four | |||
| 473 | 474 | Would generate the output: | |
| 474 | 475 | ||
| 475 | 476 | ```text | |
| 476 | - 0: node | ||
| 477 | + 0: /usr/local/bin/node | ||
| 477 | 478 | 1: /Users/mjr/work/node/process-2.js | |
| 478 | 479 | 2: one | |
| 479 | 480 | 3: two=three | |
@@ -1663,6 +1664,7 @@ cases: | |||
| 1663 | 1664 | [`process.argv`]: #process_process_argv | |
| 1664 | 1665 | [`process.exit()`]: #process_process_exit_code | |
| 1665 | 1666 | [`process.kill()`]: #process_process_kill_pid_signal | |
| 1667 | + [`process.execPath`]: #process_process_execPath | ||
| 1666 | 1668 | [`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch | |
| 1667 | 1669 | [`require.main`]: modules.html#modules_accessing_the_main_module | |
| 1668 | 1670 | [`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_arg | |
| Back | FazBrowse Home | New Git URL |
0 commit comments