Skip to content

webpod/exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

A tiny exec wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published