Is it possible to listen for incoming keystrokes in a running nodejs script? If I use process.openStdin() and listen to its \'data\' event then the
process.openStdin()
\'data\'
var stdin = process.openStdin(); require('tty').setRawMode(true); stdin.on('keypress', function (chunk, key) { process.stdout.write('Get Chunk: ' + chunk + '\n'); if (key && key.ctrl && key.name == 'c') process.exit(); });