1.0.1 • Published 11 months ago

@webpod/exec v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@webpod/exec

A tiny spawn wrapper.

import exec from '@webpod/exec'

const {ls, curl} = exec

const list = ls('-la').trim().split('\n')

const resp = curl('https://medv.io')

Usage

npm i @webpod/exec

Import any binary you would like to call. Use it like a function.

import exec from '@webpod/exec'

const {cat} = exec

const content = cat('README.md')

To get exit code or stderr, use .status or .stderr.

const {git} = exec

console.log(git('pull').status)

To pass options to the spawn, bind to an options object.

const {tee} = exec

tee.call({input: 'Hello, world!'}, 'file.txt')

License

MIT

1.0.1

11 months ago

1.0.0

12 months ago