0.3.5 • Published 11 years ago
outer-shelljs v0.3.5
outer-shelljs
ShellJS wrapper
findByRegex()grep()that accepts anygrepvariant option_(method, ...)proxy that emits events after each call
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-shelljsAPI
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
ShellJSmethod, 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