Skip to content

Instantly share code, notes, and snippets.

@XaroRSA
XaroRSA / gist:2195073df4710e3a1b079c2945731c72
Created March 28, 2018 08:06
Spawn in new Windown on linux?
var spawn = require('child_process').spawn;
var child = spawn('/home/john/.config/myapp/bin/server',['-p','4000']);
child.stdout.on('data', function(data) {
console.log('stdout: ' + data);
//Here is where the output goes
});
child.stderr.on('data', function(data) {
console.log('stderr: ' + data);
//Here is where the error output goes
});