JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q32505F
  • License MIT

executing bash scripts in js/ts

Package Exports

  • bashx

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bashx) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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)