New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

spawnly

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spawnly

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

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
368
-21.03%
Maintainers
1
Weekly downloads
 
Created
Source

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('echo "hello" && sleep 1s &&  echo "world"'); // this will happily accept commands that should run in sequence

Other examples:

describe( 'spawnly', function () {
  it( 'should execute a command in the system shell', function ( done ) {
    var spawnly = require( '../' );
    var cp = spawnly( 'echo "hello" && echo "world"' );

    cp.stdout.on( 'data', function ( data ) {
      expect( String( data ) ).to.equal( 'hello\nworld\n' );
      done();
    } );
  } );

  it( 'should execute a command in the system shell', function ( done ) {
    var spawnly = require( '../' );
    var cp = spawnly( 'echo "hello" && sleep 1s && echo "world"' );
    var data = '';
    cp.stdout.on( 'data', function ( received ) {
      data += received;
    } );

    cp.on( 'exit', function () {
      expect( data ).to.equal( 'hello\nworld\n' );
      done();
    } );
  } );
} );

Lincense

MIT

Changelog

Keywords

spawn

FAQs

Package last updated on 13 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts