lego-exeq
Execute shell commands synchronously.
Last updated 6 years ago by herbertliu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lego-exeq 
SYNC missed versions from official npm registry.

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)

Current Tags

  • 0.0.4                                ...           latest (6 years ago)

4 Versions

  • 0.0.4                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 15
Last Day 0
Last Week 0
Last Month 28
Dependencies (2)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |