On Thu, Mar 20, 2014 at 11:32 AM, q2dg2b <[email protected]> wrote: > 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) {
http://nodejs.org/api/stream.html#stream_event_data "If you attach a data event listener, then it will switch the stream into flowing mode," > 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 http://nodejs.org/api/stream.html#stream_readable_setencoding_encoding http://nodejs.org/api/buffer.html#buffer_new_buffer_str_encoding -- http://StrongLoop.com makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering. -- -- 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.
