From 0c72802757e6ba4e93bd9917bf9e3ebfc4cbcf06 Mon Sep 17 00:00:00 2001 From: Jeevankumar-S Date: Tue, 13 Jan 2026 13:24:09 +0000 Subject: [PATCH 1/7] doc: clarify process.argv[1] behavior for -e/--eval Signed-off-by: Jeevankumar-S --- doc/api/process.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index a48879338b6015..26eb8ee0a7e2ea 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -832,11 +832,7 @@ added: v0.1.27 * Type: {string\[]} The `process.argv` property returns an array containing the command-line -arguments passed when the Node.js process was launched. The first element will -be [`process.execPath`][]. See `process.argv0` if access to the original value -of `argv[0]` is needed. The second element will be the path to the JavaScript -file being executed. The remaining elements will be any additional command-line -arguments. +arguments passed when the Node.js process was launched. The first element will be [process.execPath][]. See process.argv0 if access to the original value of argv[0] is needed. The second element will be the path to the JavaScript file being executed (if a script file is provided). For no-script execution modes (e.g., -e/--eval), the second element is the first unconsumed command-line argument. The remaining elements are additional command-line arguments. For example, assuming the following script for `process-args.js`: From 7b3ec5c4fdafcaf968b896de1c5cb5d35566a9ea Mon Sep 17 00:00:00 2001 From: Jeevankumar-S Date: Sat, 17 Jan 2026 14:11:46 +0000 Subject: [PATCH 2/7] doc: restore line-wrapping --- doc/api/process.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/api/process.md b/doc/api/process.md index 26eb8ee0a7e2ea..747c1d48445d45 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -832,7 +832,13 @@ added: v0.1.27 * Type: {string\[]} The `process.argv` property returns an array containing the command-line -arguments passed when the Node.js process was launched. The first element will be [process.execPath][]. See process.argv0 if access to the original value of argv[0] is needed. The second element will be the path to the JavaScript file being executed (if a script file is provided). For no-script execution modes (e.g., -e/--eval), the second element is the first unconsumed command-line argument. The remaining elements are additional command-line arguments. +arguments passed when the Node.js process was launched. The first element +will be [process.execPath][]. See process.argv0 if access to the original +value of argv[0] is needed. The second element will be the path to the +JavaScript file being executed (if a script file is provided). For no-script +execution modes (e.g., -e/--eval), the second element is the first +unconsumed command-line argument. The remaining elements are additional +command-line arguments. For example, assuming the following script for `process-args.js`: From 9713a05127a55b2d39577abddf8baa148876c095 Mon Sep 17 00:00:00 2001 From: Jeevankumar-S Date: Sat, 17 Jan 2026 14:25:15 +0000 Subject: [PATCH 3/7] doc: restore line-wrapping p-2 --- doc/api/process.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 747c1d48445d45..db07093c6d62f4 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -832,13 +832,13 @@ added: v0.1.27 * Type: {string\[]} The `process.argv` property returns an array containing the command-line -arguments passed when the Node.js process was launched. The first element -will be [process.execPath][]. See process.argv0 if access to the original -value of argv[0] is needed. The second element will be the path to the -JavaScript file being executed (if a script file is provided). For no-script -execution modes (e.g., -e/--eval), the second element is the first -unconsumed command-line argument. The remaining elements are additional -command-line arguments. +arguments passed when the Node.js process was launched. The first element will +be [process.execPath][]. See process.argv0 if access to the original value +of argv[0] is needed. The second element will be the path to the JavaScript +file being executed (if a script file is provided). For no-script +execution modes (e.g., -e/--eval), the second element is the first unconsumed +command-line argument. The remaining elements are additional command-line +arguments. For example, assuming the following script for `process-args.js`: From e342847f9a39eb9c24d95e1a9992448d0623ad7e Mon Sep 17 00:00:00 2001 From: Jeevankumar-S Date: Sat, 17 Jan 2026 14:48:09 +0000 Subject: [PATCH 4/7] doc: restore backtick p-3 --- doc/api/process.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index db07093c6d62f4..100071b460c854 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -833,10 +833,10 @@ added: v0.1.27 The `process.argv` property returns an array containing the command-line arguments passed when the Node.js process was launched. The first element will -be [process.execPath][]. See process.argv0 if access to the original value -of argv[0] is needed. The second element will be the path to the JavaScript +be [`process.execPath`][]. See `process.argv0` if access to the original value +of `argv[0]` is needed. The second element will be the path to the JavaScript file being executed (if a script file is provided). For no-script -execution modes (e.g., -e/--eval), the second element is the first unconsumed +execution modes (e.g., `-e`/`--eval`), the second element is the first unconsumed command-line argument. The remaining elements are additional command-line arguments. From 34dc231f489e59fabcb2e599195e001c9057584d Mon Sep 17 00:00:00 2001 From: Jeevankumar-S Date: Sat, 17 Jan 2026 19:46:14 +0000 Subject: [PATCH 5/7] doc: clarify process.argv second element --- doc/api/process.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 100071b460c854..027fdc5dae6a76 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -834,10 +834,8 @@ added: v0.1.27 The `process.argv` property returns an array containing the command-line arguments passed when the Node.js process was launched. The first element will be [`process.execPath`][]. See `process.argv0` if access to the original value -of `argv[0]` is needed. The second element will be the path to the JavaScript -file being executed (if a script file is provided). For no-script -execution modes (e.g., `-e`/`--eval`), the second element is the first unconsumed -command-line argument. The remaining elements are additional command-line +of `argv[0]` is needed. If a [program entry point][] was provided, the second element +will be the absolute path to it. The remaining elements are additional command-line arguments. For example, assuming the following script for `process-args.js`: @@ -4579,6 +4577,7 @@ cases: [`process.hrtime.bigint()`]: #processhrtimebigint [`process.kill()`]: #processkillpid-signal [`process.setUncaughtExceptionCaptureCallback()`]: #processsetuncaughtexceptioncapturecallbackfn +[program entry point]: https://nodejs.org/api/cli.html#program-entry-point [`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch [`queueMicrotask()`]: globals.md#queuemicrotaskcallback [`readable.read()`]: stream.md#readablereadsize @@ -4602,4 +4601,4 @@ cases: [uv_get_constrained_memory]: https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory [uv_rusage_t]: https://docs.libuv.org/en/v1.x/misc.html#c.uv_rusage_t [wikipedia_major_fault]: https://en.wikipedia.org/wiki/Page_fault#Major -[wikipedia_minor_fault]: https://en.wikipedia.org/wiki/Page_fault#Minor +[wikipedia_minor_fault]: https://en.wikipedia.org/wiki/Page_fault#Minor \ No newline at end of file From 302531bdc61eb71a6992d2b37321c64f30df155f Mon Sep 17 00:00:00 2001 From: Jeevankumar-S Date: Sat, 17 Jan 2026 19:48:55 +0000 Subject: [PATCH 6/7] doc: order changed --- doc/api/process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/process.md b/doc/api/process.md index 027fdc5dae6a76..540ef2c5cd6007 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -4536,6 +4536,7 @@ cases: [Duplex]: stream.md#duplex-and-transform-streams [Event Loop]: https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick#understanding-processnexttick [LTS]: https://github.com/nodejs/Release +[program entry point]: https://nodejs.org/api/cli.html#program-entry-point [Permission Model]: permissions.md#permission-model [Readable]: stream.md#readable-streams [Signal Events]: #signal-events @@ -4577,7 +4578,6 @@ cases: [`process.hrtime.bigint()`]: #processhrtimebigint [`process.kill()`]: #processkillpid-signal [`process.setUncaughtExceptionCaptureCallback()`]: #processsetuncaughtexceptioncapturecallbackfn -[program entry point]: https://nodejs.org/api/cli.html#program-entry-point [`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch [`queueMicrotask()`]: globals.md#queuemicrotaskcallback [`readable.read()`]: stream.md#readablereadsize From fee8a524117b6346a87abbd1cd68b586bfad4d33 Mon Sep 17 00:00:00 2001 From: Jeevankumar-S Date: Sun, 18 Jan 2026 07:00:22 +0000 Subject: [PATCH 7/7] doc: fix markdown lint issues --- doc/api/process.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 540ef2c5cd6007..53fc735a801cf4 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -4536,8 +4536,8 @@ cases: [Duplex]: stream.md#duplex-and-transform-streams [Event Loop]: https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick#understanding-processnexttick [LTS]: https://github.com/nodejs/Release -[program entry point]: https://nodejs.org/api/cli.html#program-entry-point [Permission Model]: permissions.md#permission-model +[program entry point]: https://nodejs.org/api/cli.html#program-entry-point [Readable]: stream.md#readable-streams [Signal Events]: #signal-events [Source Map]: https://tc39.es/ecma426/ @@ -4601,4 +4601,4 @@ cases: [uv_get_constrained_memory]: https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory [uv_rusage_t]: https://docs.libuv.org/en/v1.x/misc.html#c.uv_rusage_t [wikipedia_major_fault]: https://en.wikipedia.org/wiki/Page_fault#Major -[wikipedia_minor_fault]: https://en.wikipedia.org/wiki/Page_fault#Minor \ No newline at end of file +[wikipedia_minor_fault]: https://en.wikipedia.org/wiki/Page_fault#Minor