Skip to content

Instantly share code, notes, and snippets.

@yuliji
Created September 29, 2021 04:07
Show Gist options
  • Save yuliji/ca70989d6fe2bd2a1b8b4a8358a38d2c to your computer and use it in GitHub Desktop.
Save yuliji/ca70989d6fe2bd2a1b8b4a8358a38d2c to your computer and use it in GitHub Desktop.
spawn bash in node.js
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