Skip to content

Instantly share code, notes, and snippets.

@salmanx
Created October 15, 2018 14:12
Show Gist options
  • Save salmanx/b11e9ccebcf2b84b358f69a2eb9d68ee to your computer and use it in GitHub Desktop.
Save salmanx/b11e9ccebcf2b84b358f69a2eb9d68ee to your computer and use it in GitHub Desktop.
explanation how child process works in node js
const exec = require('child_process').exec;
exec("open https://facebook.com");
exec('ls', function(err, stdout){
if(err)
console.log(err)
console.log("Listing finished..")
console.log(stdout);
});
exec("git version", function(err, result){
if(err)
console.log(err)
console.log("Listing finished..")
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment