croatia
v1.0.3
Published
Spawn a process and clear its output when succeded.
Downloads
32
Readme
croatia
Motivation
You want to clear the output of a child process when it exits without error, otherwise persist the output.
Install
yarn add croatia
Usage
const { spawn } = require('croatia')
spawn('npm', ['install', 'pokemon', '--verbose'])
Preview
This preview demonstrates:
- A successful
npm install
, the output will be cleared when succeeded. - A failed
yarn install
, the output error will be persisted.
API
spawn(cmd, [args], [options])
Almost identical to child_process.spawn
.
Returns a Promise which resolves to the created child process, the Promise will never be rejected.
options
All options in child_process.spawn are available here, plus:
options.stdio
is always[process.stdin, 'pipe', 'pipe']
options.banner
:string
Output a message before the process is spawned.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
croatia © egoist, Released under the MIT License. Authored and maintained by egoist with help from contributors (list).
github.com/egoist · GitHub @egoist · Twitter @_egoistlily