Skip to content

Instantly share code, notes, and snippets.

@ndelangen
Created January 2, 2017 14:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndelangen/8936e47730c9607ffb517238fff44911 to your computer and use it in GitHub Desktop.
Save ndelangen/8936e47730c9607ffb517238fff44911 to your computer and use it in GitHub Desktop.
Fork can spawn a new NodeJS process. You give it a javascript file to execute.
const fork = require('child_process').fork;
const program = path.resolve('other.js');
const child = fork(program);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment