Neverending Pile of Messages
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

@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

Keywords

none

install

npm i @gzzhanghao/x

Downloadsweekly downloads

38

version

1.1.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar