child_process-remote
v2.0.1
Published
child_process spawn over TCP
Downloads
13
Readme
Motivation
Execute a process through a remote endoint
API
const net = require('net');
const Server = require('child_process-remote/server');
var server = net.createServer(Server);
server.listen(8080, function() {
console.log("Server is now ready");
});
//assume server is running
const net = require('net');
const spawn = require('child_process-remote/spawn')(net.connect(8080));
var version = '';
var child = spawn('node', ['-v']);
child.stdout.on('data', function(line) {
version = line;
})
child.on('close', function(exit) {
console.log('All done, version is %s , exit code is %d', version, exit);
});