shelljs/plugin.js
Nate Fischer 8f7a7d8c57 refactor: expose plugin utils & add initial tests (#484)
* refactor: expose plugin utils & add initial tests

* fix: plugins work with Node v0.12
2016-07-26 21:32:33 -07:00

17 lines
479 B
JavaScript

// Various utilties exposed to plugins
require('./shell'); // Create the ShellJS instance (mandatory)
var common = require('./src/common');
var exportedAttributes = [
'error', // For signaling errors from within commands
'parseOptions', // For custom option parsing
'readFromPipe', // For commands with the .canReceivePipe attribute
'register', // For registering plugins
];
exportedAttributes.forEach(function (attr) {
exports[attr] = common[attr];
});