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.js
and 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.