0.0.4 • Published 9 years ago

lego-exeq v0.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

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)