nodejs stdin readable event not triggered
The readable event is not triggered in the process.stdin
test.js
var self = process.stdin, data ;
self.on('readable', function() {
var chunk = this.read();
if (chunk === null) {
handleArguments();
} else {
data += chunk;
}
});
self.on('end', function() {
console.log("end event",data )
});
Then when i do node test.jsand start typing the in the console, the
readable event is not triggered at all.
Please tell me how to attach readable listener to process.stdin stream.
No comments:
Post a Comment