outer-shelljs

ShellJS wrapper (findByRegex, events, etc.)

outer-shelljs

ShellJS wrapper

  • findByRegex()
  • grep() that accepts any grep variant option
  • _(method, ...) proxy that emits events after each call

var shelljs = require('outer-shelljs').create();
var exists = shelljs._('test', '-e', '/path/to/file');
var files = shelljs.findByRegex('/path/to/dir', /\.js$/);

NPM

npm install outer-shelljs

Documentation

Fires after any _() call.

shelljs.on('cmd', function(methodargArrayreturnVal) {
  console.log(
    'called %s with %s and returned %s',
    method, JSON.stringify(argArray), JSON.stringify(returnVal)
  );
});

Fires after a _() call for a specific ShellJS method, ex. exec.

shelljs.on('cmd:exec', function(argArrayreturnVal) {
  console.log(
    '`exec` was called with %s and returned %s',
    JSON.stringify(argArray), JSON.stringify(returnVal)
  );
});

MIT

npm test