Answer the question
In order to leave comments, you need to log in
Send child_process Control-C
var spawn = require('child_process').spawn('cmd'),
iconv = require('iconv-lite');
spawn.stdout.on('data', function (data) {
console.log('Stdout: ', iconv.decode(data, 'cp866'));
});
spawn.stderr.on('data', function (data) {
console.log('Stderr: ', iconv.decode(data, 'cp866'));
});
spawn.on('exit', function (code) {
console.log(code)
})
spawn.stdin.write('ping 8.8.8.8 -t'+ '\r\n');
Answer the question
In order to leave comments, you need to log in
Why not immediately start the child ping process? Then you can just kill him and that's it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question