Skip to content

Commit

Permalink
doc: clear up child_process command resolution
Browse files Browse the repository at this point in the history
Fixes: #20605
Refs: libuv/libuv#1837

PR-URL: #32091
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
lundibundi authored and MylesBorins committed Mar 11, 2020
1 parent fa78aa4 commit af73ed6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/api/child_process.md
Expand Up @@ -33,6 +33,14 @@ process will block waiting for the pipe buffer to accept more data. This is
identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`
option if the output will not be consumed.

The command lookup will be performed using `options.env.PATH` environment
variable if passed in `options` object, otherwise `process.env.PATH` will be
used. To account for the fact that Windows environment variables are
case-insensitive Node.js will lexicographically sort all `env` keys and choose
the first one case-insensitively matching `PATH` to perform command lookup.
This may lead to issues on Windows when passing objects to `env` option that
have multiple variants of `PATH` variable.

The [`child_process.spawn()`][] method spawns the child process asynchronously,
without blocking the Node.js event loop. The [`child_process.spawnSync()`][]
function provides equivalent functionality in a synchronous manner that blocks
Expand Down

0 comments on commit af73ed6

Please sign in to comment.