Hello.
http://nodejs.org/docs/v0.11.10/api/process.html#process_process_stdin says
"The stdin stream is paused by default, so one must call
process.stdin.resume() to read from it"
But I try this code (which is the same from the official example without
the process.stdin.resume() line from the beginning)
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
process.stdout.write('data: ' + chunk);});
process.stdin.on('end', function() {
process.stdout.write('end');});
and it works!! I mean, I can type something by keyboard and I see the echo.
Trying with pipes also works. In Linux and Windows.
Maybe there is something I miss??
Thanks!!!
P.D: Another thing: if I erase process.stdin.setEncoding("utf8") line, it
works too. Is "UTF8" the default codification for process.stdin? I can't
find the answer in documentation
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.