My code:
process.stdout.on('data',function(){
process.stdout.write('hello world detected');
process.exit();
})
process.stdout.write('hello world')
When I run this script, I just see "hello world". Then if I press enter, I see "hello world detected".
I would expect that writing to stdout would trigger the "data" event. What triggers the data event exactly?