spawndamnit

3.0.1 • Public • Published

spawndamnit

Take care of your spawn()

Features

  • Returns an await-able promise
  • Collects stdout and stderr buffers
  • Emits events "stdout" and "stderr"
  • Automatically kills all spawn processes when parent process dies

Installation

yarn add spawndamnit

Usage

Basic:

const spawn = require('spawndamnit');

async function main() {
  let child = spawn('npm', ['star', 'spawndamnit']);

  child.on('stdout', data => console.log(data.toString()));
  child.on('stderr', data => console.error(data.toString()));

  let { code, stdout, stderr } = await child;

  console.log(code === 0 ? 'success' : 'error');
}

/spawndamnit/

    Package Sidebar

    Install

    npm i spawndamnit

    Weekly Downloads

    1,282,935

    Version

    3.0.1

    License

    SEE LICENSE IN LICENSE

    Unpacked Size

    4.48 kB

    Total Files

    6

    Last publish

    Collaborators

    • thejameskyle