Created
October 15, 2018 14:12
-
-
Save salmanx/b11e9ccebcf2b84b358f69a2eb9d68ee to your computer and use it in GitHub Desktop.
explanation how child process works in node js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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