@@ -457,9 +457,10 @@ added: v0.1.27
|
457 | 457 | |
458 | 458 | The `process.argv` property returns an array containing the command line |
459 | 459 | arguments passed when the Node.js process was launched. The first element will |
460 | | -be [`process.execPath`]. The second element will be the path to the |
461 | | -JavaScript file being executed. The remaining elements will be any additional |
462 | | -command line arguments. |
| 460 | +be [`process.execPath`]. See `process.argv0` if access to the original value of |
| 461 | +`argv[0]` is needed. The second element will be the path to the JavaScript |
| 462 | +file being executed. The remaining elements will be any additional command line |
| 463 | +arguments. |
463 | 464 | |
464 | 465 | For example, assuming the following script for `process-args.js`: |
465 | 466 | |
@@ -486,6 +487,22 @@ Would generate the output:
|
486 | 487 | 4: four |
487 | 488 | ``` |
488 | 489 | |
| 490 | +## process.argv0 |
| 491 | +<!-- YAML |
| 492 | +added: REPLACEME |
| 493 | +--> |
| 494 | + |
| 495 | +The `process.argv0` property stores a read-only copy of the original value of |
| 496 | +`argv[0]` passed when Node.js starts. |
| 497 | + |
| 498 | +```js |
| 499 | +$ bash -c 'exec -a customArgv0 ./node' |
| 500 | +> process.argv[0] |
| 501 | +'/Volumes/code/external/node/out/Release/node' |
| 502 | +> process.argv0 |
| 503 | +'customArgv0' |
| 504 | +``` |
| 505 | + |
489 | 506 | ## process.chdir(directory) |
490 | 507 | <!-- YAML |
491 | 508 | added: v0.1.17 |
|