Socket
Book a DemoInstallSign in
Socket

lego-exeq

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

lego-exeq

Execute shell commands synchronously.

latest
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

lego-exeq

Excute shell commands synchronously.

NPM version Build Status NPM downloads

Install

$ npm install lego-exeq --save

Usage

exeq(array)

var exeq = require('lego-exeq');

// cd command would change spawn cwd automatically
exeq([
  'mkdir example',
  'cd example',
  'touch README.md'
]);
// each & done events
exeq([
  'mkdir example',
  'cd example',
  'touch README.md',
  'touch somefile',
  'rm somefile',
  'ls -l',
  'cd ..',
  'rm -rf example',
  'ls -l > output.txt'
]).on('each', function(command, index) {
  // After each command executed
  console.log('No.' + index + ' Executed: ' + command);
  console.log();
}).on('done', function(count) {
  console.log('---');
  console.log(count + ' commands done!');
});

Do not support command string with && .

Test

$ npm test

License

The MIT License (MIT)

Keywords

spawn

FAQs

Package last updated on 04 Feb 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