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)

Package Sidebar

Install

npm i lego-exeq

Weekly Downloads

9

Version

0.0.4

License

MIT

Last publish

Collaborators

  • herbertliu