croatia
Spawn a process and clear its output when succeded.
Last updated 8 years ago by egoist .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install croatia 
SYNC missed versions from official npm registry.

croatia

NPM version NPM downloads travis donate chat

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. 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

Current Tags

  • 1.0.3                                ...           latest (8 years ago)

5 Versions

  • 1.0.3                                ...           8 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
  • 0.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Total 26
Today 0
This Week 0
This Month 21
Last Day 0
Last Week 4
Last Month 5
Dependencies (3)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE