@gzzhanghao/x

Execute commands in node

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Dec 14, 2016Dec 10, 2016Minified + gzip package size for @gzzhanghao/x in KB

Readme

X

Execute commands in node.js

Installation

npm i -S @gzzhanghao/x

Usage

import { x } from '@gzzhanghao/x'

export async function build(opts) {
  await x(`
    run-any-cmd --with-args ${x.e.SOME_ENV_VARIABLE}
    like makefile
  `)
}

e

Identical to process.env.

x(commands[, options])

Execute series of commands. Pass an array to run commands in parallel.

await x(['rm -rf dist', 'mkdir tmp'])

g(command[, options])

Get output from a command.

await g('ls -alh') // -> { code, signal, stdout, stdin, encoding }
'' + await g('ls') // -> ls's stdout

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.