UNPKG

nesh

Version:

An enhanced, extensible shell for Node.js

52 lines (42 loc) 1.25 kB
// Generated by CoffeeScript 1.11.1 /* Version Information Plugin ========================== This plugin adds a new command to the repl called `.versions` that will print out version information for nesh, any loaded languages, and Node itself. The new command is listed with a description when you run `.help`. */ (function() { var nesh; nesh = require('../nesh'); exports.name = 'version'; exports.description = 'Adds a .versions command'; exports.setup = function(context) { return process.versions.nesh = nesh.version; }; exports.postStart = function(context) { var cmd, repl; repl = context.repl; cmd = { help: 'Show Node version information', action: function() { var key, value, versions; versions = ((function() { var ref, results; ref = process.versions; results = []; for (key in ref) { value = ref[key]; results.push(key + " " + value); } return results; })()).join('\n'); repl.outputStream.write(versions + "\n"); return repl.displayPrompt(); } }; return repl.defineCommand('versions', cmd); }; }).call(this); //# sourceMappingURL=version.js.map