Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: clear up child_process command resolution
  • Loading branch information
lundibundi committed Mar 4, 2020
commit 9e0f53045dbb13adb3c6921f02186e0bec30b939
8 changes: 8 additions & 0 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
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
Comment thread
richardlau marked this conversation as resolved.
Resolved
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-insensitivety matching `'PATH'` to perform command lookup.
Comment thread
lundibundi marked this conversation as resolved.
Resolved
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