spawnly

1.0.3 • Public • Published

NPM Version Build Status

spawnly

Wrapper around child_process.spawn to enable pass the command as a string directly to spawn

Install

npm i --save spawnly

Usage

var spawnly = require('spawnly');
 
var cp = spawnly('./some-command --some-param=true');

Other examples:

describe( 'spawnly', function () {
  it( 'should execute a command in the system shell', function ( done ) {
    var spawnly = require( '../' );
    var cp = spawnly( 'echo \'hello world\'' );
 
    cp.stdout.on( 'data', function ( data ) {
      expect( String( data ) ).to.equal( '\'hello world\'\n' );
      done();
    } );
  } );
 
  it( 'should execute a command in the system shell', function ( done ) {
    var spawnly = require( '../' );
    var cp = spawnly( 'echo hello world' );
    var data = '';
 
    cp.stdout.on( 'data', function ( received ) {
      data += received;
    } );
 
    cp.on( 'exit', function () {
      expect( data ).to.equal( 'hello world\n' );
      done();
    } );
  } );
 
} );
 

Lincense

MIT

Changelog

/spawnly/

    Package Sidebar

    Install

    npm i spawnly

    Weekly Downloads

    136

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    7.21 kB

    Total Files

    7

    Last publish

    Collaborators

    • royriojas