Created
September 29, 2021 04:07
-
-
Save yuliji/ca70989d6fe2bd2a1b8b4a8358a38d2c to your computer and use it in GitHub Desktop.
spawn bash in node.js
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 child_process = require('child_process'); | |
const ls = child_process.spawn('bash', [], { stdio: 'inherit' }); | |
ls.on('close', (code) => { | |
console.log(`child process exited with code ${code}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment