Skip to content

Commit 52dd524

Browse files
committed
doc: revise introductory child_process text
This consolidates information about Windows environment variables and has a few other smaller improvements (punctuation, present tense, etc.). Co-authored-by: Shelley Vohr <codebytere@gmail.com> PR-URL: #35296 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 785a5f9 commit 52dd524

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

doc/api/child_process.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
<!-- source_link=lib/child_process.js -->
88

9-
The `child_process` module provides the ability to spawn child processes in
9+
The `child_process` module provides the ability to spawn subprocesses in
1010
a manner that is similar, but not identical, to popen(3). This capability
1111
is primarily provided by the [`child_process.spawn()`][] function:
1212

@@ -28,24 +28,23 @@ ls.on('close', (code) => {
2828
```
2929

3030
By default, pipes for `stdin`, `stdout`, and `stderr` are established between
31-
the parent Node.js process and the spawned child. These pipes have
32-
limited (and platform-specific) capacity. If the child process writes to
33-
stdout in excess of that limit without the output being captured, the child
34-
process will block waiting for the pipe buffer to accept more data. This is
31+
the parent Node.js process and the spawned subprocess. These pipes have
32+
limited (and platform-specific) capacity. If the subprocess writes to
33+
stdout in excess of that limit without the output being captured, the
34+
subprocess blocks waiting for the pipe buffer to accept more data. This is
3535
identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`
3636
option if the output will not be consumed.
3737

38-
The command lookup will be performed using `options.env.PATH` environment
39-
variable if passed in `options` object, otherwise `process.env.PATH` will be
40-
used. To account for the fact that Windows environment variables are
41-
case-insensitive Node.js will lexicographically sort all `env` keys and choose
42-
the first one case-insensitively matching `PATH` to perform command lookup.
43-
This may lead to issues on Windows when passing objects to `env` option that
44-
have multiple variants of `PATH` variable.
45-
46-
On Windows Node.js will sanitize the `env` by removing case-insensitive
47-
duplicates. Only first (in lexicographic order) entry will be passed to the
48-
child process.
38+
The command lookup is performed using the `options.env.PATH` environment
39+
variable if it is in the `options` object. Otherwise, `process.env.PATH` is
40+
used.
41+
42+
On Windows, environment variables are case-insensitive. Node.js
43+
lexicographically sorts the `env` keys and uses the first one that
44+
case-insensitively matches. Only first (in lexicographic order) entry will be
45+
passed to the subprocess. This may lead to issues on Windows when passing
46+
objects to `env` option that have multiple variants of the same key, such as
47+
`PATH` and `Path`.
4948

5049
The [`child_process.spawn()`][] method spawns the child process asynchronously,
5150
without blocking the Node.js event loop. The [`child_process.spawnSync()`][]

doc/guides/collaborator-guide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,12 @@ code. If you wish to create the token yourself in advance, see
469469

470470
### Technical HOWTO
471471

472+
Infrequently, it is necessary to manually perform the steps required to land a
473+
pull request rather than rely on `git-node`.
474+
475+
<details>
476+
<summary>Manual landing steps</summary>
477+
472478
Clear any `am`/`rebase` that might already be underway:
473479

474480
```text
@@ -626,6 +632,8 @@ your pull request shows the purple merged status,
626632
add the "Landed in \<commit hash>..\<commit hash>" comment if you added
627633
more than one commit.
628634

635+
</details>
636+
629637
### Troubleshooting
630638

631639
Sometimes, when running `git push upstream master`, you might get an error

0 commit comments

Comments
 (0)