UNPKG

nesh

Version:

An enhanced, extensible shell for Node.js

39 lines (29 loc) 1.04 kB
// Generated by CoffeeScript 1.11.1 /* Welcome Message Plugin ====================== This plugin adds a new option to the repl opts called `welcome` that, if set, will display the set string before starting the interpreter. The welcome message can be set like so: nesh.start {welcome: 'Hello!'}, (err) -> console.log err if err */ (function() { require('colors'); exports.name = 'welcome'; exports.description = 'Displays a welcome message on startup'; exports.setup = function(context) { var defaults; defaults = context.nesh.defaults; return defaults.welcome != null ? defaults.welcome : defaults.welcome = ("Node " + process.version + "\nType ") + ".help".cyan + " for more information"; }; exports.preStart = function(context) { var options, outStream; options = context.options; if (options.welcome) { outStream = options.outputStream || process.stdout; return outStream.write(options.welcome + "\n"); } }; }).call(this); //# sourceMappingURL=welcome.js.map