var ps = spawn('cmd', args); ps.stdin.write('hello\n'); ps.stdout.on('data', function (buf) { console.log('read: ' + buf) })