Détail du package

spawnly

royriojas261MIT1.0.3

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

spawn, exec, command, safe spawn

readme

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

changelog

spawnly - Changelog

v1.0.3

  • Build Scripts Changes
    • remove older node versions from travis.yml - 15021f0, Roy Riojas, 10/07/2019 05:56:12

v1.0.2

  • Build Scripts Changes

v1.0.1

  • Documentation
    • change readme to remove examples of commands executed in sequence - d0a2c75, royriojas, 26/08/2015 20:09:37

v1.0.0

  • Refactoring
    • do not use /bin/sh because the process created this way cannot be killed - d04b094, royriojas, 13/08/2015 00:24:04

v0.1.0

  • Features