cp = require('child_process')
switch (process.platform) {
case 'win32':
ChildProcess = cp.spawn('cmd').constructor;
ChildProcess.prototype.kill = function() {
cp.exec("taskkill /F /T /PID " + this.pid, function(error, stdout, stderr) {
if (error) {
throw error;
}
});
};
spawn = function(command, commandline) {
cp.spawn('cmd', ['/C', command].concat(commandline));
};
break;
default:
ChildProcess = cp.spawn('ls').constructor;
ChildProcess.prototype.kill = function() {
cp.exec("kill -TERM -" + this.pid, function(error, stdout, stderr) {
if (error) {
throw error;
}
});
spawn = function(command, commandline) {
cp.spawn(command, commandline, {
detach: true
});
};
};
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/3ba5d6a6-cabf-4270-ae4b-52b9094b343c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/2765591407705954%40web27m.yandex.ru.