Created
October 3, 2018 21:41
-
-
Save rjcorwin/b56ff2fbb6428e2af352ef67e339c085 to your computer and use it in GitHub Desktop.
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 util = require('util'); | |
const exec = util.promisify(require('child_process').exec) | |
const go = async () => { | |
try { | |
const output1 = await exec('echo 1') | |
console.log(output1.stdout) | |
const output2 = await exec('echo 2') | |
console.log(output2.stdout) | |
const output3 = await exec('echo 3') | |
console.log(output3.stdout) | |
} catch (error) { | |
console.log('An exec process exited with a status code other than 0') | |
console.log(error) | |
} | |
} | |
go() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment