@gzzhanghao/x

1.1.5 • Public • Published

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

Dependencies (3)

Dev Dependencies (4)

Package Sidebar

Install

npm i @gzzhanghao/x

Weekly Downloads

2

Version

1.1.5

License

MIT

Last publish

Collaborators

  • gzzhanghao