outer-shelljs

ShellJS wrapper (findByRegex, events, etc.)

npm install outer-shelljs
12 downloads in the last week
34 downloads in the last month

outer-shelljs

ShellJS wrapper

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

Build Status

Example

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

Installation

NPM

npm install outer-shelljs

API

Documentation

Events

cmd

Fires after any _() call.

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

cmd:<method>

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

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

License

MIT

Tests

npm test
npm loves you