Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fixes default shell in child_process.md #14203

Closed
wants to merge 7 commits into from
Closed
Changes from 3 commits
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
34 changes: 21 additions & 13 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Child Process
# Child Process

> Stability: 2 - Stable

Expand Down Expand Up @@ -133,9 +133,11 @@ added: v0.1.90
* `env` {Object} Environment key-value pairs
* `encoding` {string} (Default: `'utf8'`)
* `shell` {string} Shell to execute the command with
(Default: `'/bin/sh'` on UNIX, `'cmd.exe'` on Windows, The shell should
understand the `-c` switch on UNIX or `/d /s /c` on Windows. On Windows,
command line parsing should be compatible with `cmd.exe`.)
(Default: `'/bin/sh'` on UNIX, `'process.env.ComSpec'` on Windows. If
`'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows
instead. The shell should understand the `-c` switch on UNIX or
`/d /s /c` on Windows. On Windows, command line parsing should be
compatible with `cmd.exe`.)
* `timeout` {number} (Default: `0`)
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
stderr. (Default: `200*1024`) If exceeded, the child process is terminated.
Expand Down Expand Up @@ -382,9 +384,11 @@ changes:
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
`'/bin/sh'` on UNIX, and `'cmd.exe'` on Windows. A different shell can be
specified as a string. The shell should understand the `-c` switch on UNIX,
or `/d /s /c` on Windows. Defaults to `false` (no shell).
`'/bin/sh'` on UNIX, and `'process.env.ComSpec'` on Windows. If
`'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows
instead. A different shell can be specified as a string. The shell should
understand the `-c` switch on UNIX, or `/d /s /c` on Windows. Defaults
to `false` (no shell).
* Returns: {ChildProcess}

The `child_process.spawn()` method spawns a new process using the given
Expand Down Expand Up @@ -707,9 +711,11 @@ changes:
`stdio` is specified
* `env` {Object} Environment key-value pairs
* `shell` {string} Shell to execute the command with
(Default: `'/bin/sh'` on UNIX, `'cmd.exe'` on Windows, The shell should
understand the `-c` switch on UNIX or `/d /s /c` on Windows. On Windows,
command line parsing should be compatible with `cmd.exe`.)
(Default: `'/bin/sh'` on UNIX, `'process.env.ComSpec'` on Windows.
If `'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows
instead. The shell should understand the `-c` switch on UNIX or
`/d /s /c` on Windows. On Windows, command line parsing should be
compatible with `cmd.exe`.)
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `timeout` {number} In milliseconds the maximum amount of time the process
Expand Down Expand Up @@ -775,9 +781,11 @@ changes:
* `encoding` {string} The encoding used for all stdio inputs and outputs.
(Default: `'buffer'`)
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
`'/bin/sh'` on UNIX, and `'cmd.exe'` on Windows. A different shell can be
specified as a string. The shell should understand the `-c` switch on UNIX,
or `/d /s /c` on Windows. Defaults to `false` (no shell).
`'/bin/sh'` on UNIX, and `'process.env.ComSpec'` on Windows. If
`'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows
instead. A different shell can be specified as a string. The shell should
understand the `-c` switch on UNIX, or `/d /s /c` on Windows. Defaults
to `false` (no shell).
* Returns: {Object}
* `pid` {number} Pid of the child process
* `output` {Array} Array of results from stdio output
Expand Down