From 749997b34b60b877fe1ca2e815c7ab2c9c0c3694 Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Sun, 7 Apr 2024 22:31:27 +0200 Subject: [PATCH 1/4] doc: update `process.execArg` example to be more useful --- 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 ef1aae1f12649f..06feec9de9323a 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1711,7 +1711,7 @@ the script name. These options are useful in order to spawn child processes with the same execution environment as the parent. ```bash -node --harmony script.js --version +node --input-type=module --eval 'console.log("foo")' script.js --version ``` Results in `process.execArgv`: @@ -1719,7 +1719,7 @@ Results in `process.execArgv`: ```js -['--harmony'] +['--input-type=module', '--eval', 'console.log("foo")'] ``` And `process.argv`: From 2361daa8039968f2e080571c5d8c1be8127d4c6b Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:20:26 +0200 Subject: [PATCH 2/4] fixup!: switch flags used --- 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 06feec9de9323a..34f7bf75409a2f 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1711,7 +1711,7 @@ the script name. These options are useful in order to spawn child processes with the same execution environment as the parent. ```bash -node --input-type=module --eval 'console.log("foo")' script.js --version +node --watch-path=./foo --require ./bar.js script.js --version ``` Results in `process.execArgv`: @@ -1719,7 +1719,7 @@ Results in `process.execArgv`: ```js -['--input-type=module', '--eval', 'console.log("foo")'] +['--watch-path=./foo', '--require', './bar.js'] ``` And `process.argv`: From 8ed33f8fb2f230d4210227ae2cf8c82c1af26af9 Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:33:49 -0400 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Antoine du Hamel --- doc/api/process.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 34f7bf75409a2f..ab196b69c53995 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1711,15 +1711,13 @@ the script name. These options are useful in order to spawn child processes with the same execution environment as the parent. ```bash -node --watch-path=./foo --require ./bar.js script.js --version +node --icu-data-dir=./foo --require ./bar.js script.js --version ``` Results in `process.execArgv`: - - -```js -['--watch-path=./foo', '--require', './bar.js'] +```json +['--icu-data-dir=./foo', '--require', './bar.js'] ``` And `process.argv`: From 8a62939ef6e8d521fd289ab55901b149a3048090 Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:38:24 +0200 Subject: [PATCH 4/4] Update process.md Co-authored-by: Antoine du Hamel --- 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 ab196b69c53995..1b009f21887c0b 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1717,7 +1717,7 @@ node --icu-data-dir=./foo --require ./bar.js script.js --version Results in `process.execArgv`: ```json -['--icu-data-dir=./foo', '--require', './bar.js'] +["--icu-data-dir=./foo", "--require", "./bar.js"] ``` And `process.argv`: