Created
October 11, 2018 12:46
-
-
Save bennycode/4b3bf5de6827c83726cdf70b3d563768 to your computer and use it in GitHub Desktop.
Node.js spawn example
This file contains 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 {spawn} = require('child_process'); | |
const child = spawn('node', ['--version'], { | |
shell: true, | |
stdio: 'inherit', | |
}); | |
child.on('exit', () => { | |
console.log('Command finished.'); | |
process.exit(0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment