Skip to content

Instantly share code, notes, and snippets.

@ndelangen
Created January 2, 2017 15:01
Show Gist options
  • Save ndelangen/d416688c60888e948ae47ea1de4756f8 to your computer and use it in GitHub Desktop.
Save ndelangen/d416688c60888e948ae47ea1de4756f8 to your computer and use it in GitHub Desktop.
Spawn can be used to create a process from any command.
const spawn = require('child_process').spawn;
const command = 'node';
const parameters = [path.resolve('program.js')];
const child = spawn(command, parameters, {
stdio: [ 'pipe', 'pipe', 'pipe', 'ipc' ]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment