@gershy/nodejs-proc
v0.0.7
Published
TODO
Readme
Node.js Proc
Makes it easy to run child processes when the nodejs node:child_process module is available.
import proc from '@grershy/nodejs-proc';
const repoHasChanges = await proc('git status', { cwd: '/path/to/my/repo' }).then(res => {
return res.output[has]('working tree clean');
});Proc Current Working Directory
- Default current-working-directory is filesystem root (careful with
proc('rm -rf')!!)
Proc Environment Vars
By default process.env is passed to proc. To control the environment vars, use:
await proc('my command', { env: { ENV_VAR: 'custom env var' } });