Skip to content

Commit 2860c53

Browse files
tylerantonjasnell
authored andcommitted
doc: fixed child_process.exec doc
Changed child_process.exec documentation to reflect that the parameters stdout and stderr are instances of Buffer only if {encoding: null}. Otherwise, they are instances of String with the encoding. Fixes #9434 removed .DS_Store PR-URL: nodejs/node-v0.x-archive#14088 Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: piscisaureus - Bert Belder <bertbelder@gmail.com>
1 parent b5a0abc commit 2860c53

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/api/child_process.markdown

+7-5
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,11 @@ index corresponds to a fd in the child. The value is one of the following:
460460
ignored node will open `/dev/null` and attach it to the child's fd.
461461
4. `Stream` object - Share a readable or writable stream that refers to a tty,
462462
file, socket, or a pipe with the child process. The stream's underlying
463-
file descriptor is duplicated in the child process to the fd that
463+
file descriptor is duplicated in the child process to the fd that
464464
corresponds to the index in the `stdio` array. Note that the stream must
465465
have an underlying descriptor (file streams do not until the `'open'`
466466
event has occurred).
467-
5. Positive integer - The integer value is interpreted as a file descriptor
467+
5. Positive integer - The integer value is interpreted as a file descriptor
468468
that is is currently open in the parent process. It is shared with the child
469469
process, similar to how `Stream` objects can be shared.
470470
6. `null`, `undefined` - Use default value. For stdio fds 0, 1 and 2 (in other
@@ -488,7 +488,7 @@ Example:
488488
### options.detached
489489

490490
If the `detached` option is set, the child process will be made the leader of a
491-
new process group. This makes it possible for the child to continue running
491+
new process group. This makes it possible for the child to continue running
492492
after the parent exits.
493493

494494
By default, the parent will wait for the detached child to exit. To prevent
@@ -544,8 +544,10 @@ See also: `child_process.exec()` and `child_process.fork()`
544544
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
545545
* `callback` {Function} called with the output when process terminates
546546
* `error` {Error}
547-
* `stdout` {Buffer}
548-
* `stderr` {Buffer}
547+
* `stdout` {Buffer} only if {encoding: null}, otherwise {String}
548+
encoded with the specified encoding or {String} (Default: 'utf8').
549+
* `stderr` {Buffer} only if {encoding: null}, otherwise {String}
550+
encoded with the specified encoding or {String} (Default: 'utf8').
549551
* Return: ChildProcess object
550552

551553
Runs a command in a shell and buffers the output.

0 commit comments

Comments
 (0)