nesh
Version:
An enhanced, extensible shell for Node.js
34 lines (24 loc) • 687 B
JavaScript
// Generated by CoffeeScript 1.11.1
/*
Eval plugin for Nesh to evaluate code within the REPL context.
*/
(function() {
var log, vm;
log = require('../log');
vm = require('vm');
exports.name = 'eval';
exports.description = 'Evaluates code in the context of the REPL';
exports.postStart = function(context) {
var repl;
repl = context.repl;
if (repl.opts.evalData) {
log.debug('Evaluating code in the REPL');
if (global === repl.context) {
return vm.runInThisContext(repl.opts.evalData);
} else {
return vm.runInContext(repl.opts.evalData, repl.context);
}
}
};
}).call(this);
//# sourceMappingURL=eval.js.map