Small promise wrapper around node's `child_process#exec` allowing you to use async/await syntax for commands you want to execute.
npm install await-exec-typescriptchild_process#exec allowing you to use async/await syntax for commands you want to execute.
js
const exec = require('await-exec')
async function logger (text) {
await exec(echo ${text})
}
for (let k = 0; k < 10; k++) {
logger('worked!')
}
`
Optinally you can pass a second Object that will get directly passed to cp#exec
Modern Usage
`
import exec from "await-exec"
async function logger (text) {
const { stdout, stderr } = await exec('python --version')
console.log(stdout, stderr)
}
`
Questions? Feedback? Please let me know
License (MIT)
`
WWWWWW||WWWWWW
W W W||W W W
||
( OO )__________
/ | \
/o o| MIT \
\___/||_||__||_|| *
|| || || ||
_||_|| _||_||
(__|__|(__|__|
``