process.stdin.setEncoding('utf8') process.stdin.on('data', function(input) { if (input !== null) { process.stdout.write(input) if ( input.trim() === 'exit') { process.exit(0); } } })