summaryrefslogtreecommitdiff
path: root/doc/api/child_process.md
diff options
context:
space:
mode:
authorJames Bromwell <943160+thw0rted@users.noreply.github.com>2018-08-14 10:16:29 +0200
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-08-14 22:38:51 +0300
commitdccec3f3ecff72a8742be7e234f6cf6bef76cfdf (patch)
treee3f31abf1a21b70631d3579294da1fbd29dbf187 /doc/api/child_process.md
parentfc846662637af5372d234cdf2f2e0314a73bcd31 (diff)
downloadandroid-node-v8-dccec3f3ecff72a8742be7e234f6cf6bef76cfdf.tar.gz
android-node-v8-dccec3f3ecff72a8742be7e234f6cf6bef76cfdf.tar.bz2
android-node-v8-dccec3f3ecff72a8742be7e234f6cf6bef76cfdf.zip
doc: document 'inherit' option for stdio (non-shorthand)
PR-URL: https://github.com/nodejs/node/pull/22309 Fixes: https://github.com/nodejs/node/issues/22297 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc/api/child_process.md')
-rw-r--r--doc/api/child_process.md13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/api/child_process.md b/doc/api/child_process.md
index de343464a0..d6a7942188 100644
--- a/doc/api/child_process.md
+++ b/doc/api/child_process.md
@@ -599,8 +599,7 @@ For convenience, `options.stdio` may be one of the following strings:
* `'pipe'` - equivalent to `['pipe', 'pipe', 'pipe']` (the default)
* `'ignore'` - equivalent to `['ignore', 'ignore', 'ignore']`
-* `'inherit'` - equivalent to `[process.stdin, process.stdout, process.stderr]`
- or `[0,1,2]`
+* `'inherit'` - equivalent to `['inherit', 'inherit', 'inherit']` or `[0, 1, 2]`
Otherwise, the value of `options.stdio` is an array where each index corresponds
to an fd in the child. The fds 0, 1, and 2 correspond to stdin, stdout,
@@ -626,16 +625,20 @@ pipes between the parent and child. The value is one of the following:
will always open fds 0 - 2 for the processes it spawns, setting the fd to
`'ignore'` will cause Node.js to open `/dev/null` and attach it to the
child's fd.
-4. {Stream} object - Share a readable or writable stream that refers to a tty,
+4. `'inherit'` - Pass through the corresponding stdio stream to/from the
+ parent process. In the first three positions, this is equivalent to
+ `process.stdin`, `process.stdout`, and `process.stderr`, respectively. In
+ any other position, equivalent to `'ignore'`.
+5. {Stream} object - Share a readable or writable stream that refers to a tty,
file, socket, or a pipe with the child process. The stream's underlying
file descriptor is duplicated in the child process to the fd that
corresponds to the index in the `stdio` array. Note that the stream must
have an underlying descriptor (file streams do not until the `'open'`
event has occurred).
-5. Positive integer - The integer value is interpreted as a file descriptor
+6. Positive integer - The integer value is interpreted as a file descriptor
that is currently open in the parent process. It is shared with the child
process, similar to how {Stream} objects can be shared.
-6. `null`, `undefined` - Use default value. For stdio fds 0, 1, and 2 (in other
+7. `null`, `undefined` - Use default value. For stdio fds 0, 1, and 2 (in other
words, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the
default is `'ignore'`.