Have ideas to improve npm?Join in the discussion! »

lego-exeq

0.0.4 • Public • Published

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)

Install

npm i lego-exeq

DownloadsWeekly Downloads

6

Version

0.0.4

License

MIT

Last publish

Collaborators

  • avatar