Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 35ee35c

Browse filesBrowse files
sartreyMyles Borins
authored andcommitted
doc: clarify child_process stdout/stderr types
Clarify how the encoding option interacts with the data type of child process stdout and stderr. Fixes: #6666 PR-URL: #7361 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent c8e9adb commit 35ee35c
Copy full SHA for 35ee35c

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/child_process.md‎

Copy file name to clipboardExpand all lines: doc/api/child_process.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ The `stdout` and `stderr` arguments passed to the callback will contain the
160160
stdout and stderr output of the child process. By default, Node.js will decode
161161
the output as UTF-8 and pass strings to the callback. The `encoding` option
162162
can be used to specify the character encoding used to decode the stdout and
163-
stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to
164-
the callback instead.
163+
stderr output. If `encoding` is `'buffer'`, or an unrecognized character
164+
encoding, `Buffer` objects will be passed to the callback instead.
165165

166166
The `options` argument may be passed as the second argument to customize how
167167
the process is spawned. The default options are:
@@ -230,8 +230,8 @@ The `stdout` and `stderr` arguments passed to the callback will contain the
230230
stdout and stderr output of the child process. By default, Node.js will decode
231231
the output as UTF-8 and pass strings to the callback. The `encoding` option
232232
can be used to specify the character encoding used to decode the stdout and
233-
stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to
234-
the callback instead.
233+
stderr output. If `encoding` is `'buffer'`, or an unrecognized character
234+
encoding, `Buffer` objects will be passed to the callback instead.
235235

236236
### child_process.fork(modulePath[, args][, options])
237237

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.