JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21874
  • Score
    100M100P100Q143370F

Buffered child process#spawn.

Package Exports

  • buffered-spawn

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (buffered-spawn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

buffered-spawn Build Status

Buffered child_process#spawn.

Installation

$ npm install buffered-spawn

Why

  • Simplify executing commands on node
  • Easy to use
  • Fixes Windows issues with some commands
  • Supports callback & promise style

Usage

In terms of arguments, they are equal to node's spawn.

var buffspawn('buffered-spawn');

// Callback style
buffspawn('git', ['clone', 'git@github.com/bower/bower'], { cwd: '~/foo' }, function (err, stdout, stderr) {
    if (err) {
        return console.err('Command failed with error code of #'  + err.status);
    }

    console.log(stdout);
    console.log(stderr);
});

// Promise style
buffspawn('git', ['clone', 'git@github.com/bower/bower'], { cwd: '~/foo' })
.spread(function (stdout, stderr) {
    console.log(stdout);
    console.log(stderr);
}, function (err) {
    console.err('Command failed with error code of #'  + err.status);
});

// Promise style with progress
buffspawn('git', ['clone', 'git@github.com/bower/bower'], { cwd: '~/foo' })
.progress(function (buff) {
    console.log(buff.toString());
})
.spread(function (stdout, stderr) {
    console.log('---------------------------');
    console.log(stdout);
    console.log(stderr);
}, function (err) {
    console.err('Command failed with error code of #'  + err.status);
});

Tests

$ npm test

License

Released under the MIT License.