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 354fba1

Browse filesBrowse files
committed
doc: fix process.stdin example
Fixes: #20503 PR-URL: #25344 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent eaaaa0d commit 354fba1
Copy full SHA for 354fba1

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/process.md‎

Copy file name to clipboardExpand all lines: doc/api/process.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1856,8 +1856,9 @@ a [Readable][] stream.
18561856
process.stdin.setEncoding('utf8');
18571857

18581858
process.stdin.on('readable', () => {
1859-
const chunk = process.stdin.read();
1860-
if (chunk !== null) {
1859+
let chunk;
1860+
// Use a loop to make sure we read all available data.
1861+
while ((chunk = process.stdin.read()) !== null) {
18611862
process.stdout.write(`data: ${chunk}`);
18621863
}
18631864
});

0 commit comments

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