ShellJS wrapper (findByRegex, events, etc.)
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
lib/outer-shelljs
test/lib/outer-shelljs
.gitignore
.travis.yml
CHANGELOG.md
Gruntfile.js
LICENSE
README.md
index.js
package.json

README.md

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