★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/8d5ac6c8efNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
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>
  • Loading branch information
addaleax authored and MylesBorins committed May 16, 2019
1 parent 73230cc commit 8d5ac6c8ef9a98ff58ea55a3dd1420159484053f
Showing with 3 additions and 2 deletions.
  1. +3 −2 doc/api/process.md
@@ -1863,8 +1863,9 @@ a [Readable][] stream.
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
const chunk = process.stdin.read();
if (chunk !== null) {
let chunk;
// Use a loop to make sure we read all available data.
while ((chunk = process.stdin.read()) !== null) {
process.stdout.write(`data: ${chunk}`);
}
});

0 comments on commit 8d5ac6c

Please sign in to comment.