BashX
Execute commands in JS/TS. A warp of child_process.spawn
, which allows you process command return values in JS/TS.
I love bash,but am not good at it
Quick start
Install
npm i bashx
Usage
import { x } from 'bashx'
void (async()=>{
const output = await x`echo 'this is awesome'`
console.log(output)
// { code: 0, stdout: 'hello\n', stderr: '' }
const url = https://example.com/example.json
const ret = await x`curl -s ${url}`
console.log(JSON.parse(ret.stdout))
// { example:'json' }
})().catch(console.log)