Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
output += ' ';
output += ansicolors.brightBlack(entry.time);
output += ' ';
if (entry.req && entry.res) {
output += util.format('%s %s ', entry.req.method, entry.req.url);
output += levelColor(entry.res.statusCode);
output += ansicolors.brightBlack(util.format(' %dms - %d', entry.res.responseTime, entry.res.contentLength));
} else if (entry.msg) {
output += entry.msg;
}
process.stdout.write(output + '\n');
if (entry.err) {
process.stdout.write(ansicolors.brightRed(entry.err.stack) + '\n');
}
callback();
};
function pluginIsEnabled (x) {
return config.plugins[x] === undefined || config.plugins[x] === true;
}
var enabledPlugins = config.plugins && typeof config.plugins === 'object'
? allPlugins.filter(pluginIsEnabled)
: allPlugins;
var specs = { cpus: Object.keys(os.cpus()).length, platform: os.platform(), host: os.hostname() }
, v = process.versions
, plugins = enabledPlugins.map(colors.yellow).join(' | ');
var msgs = [
''
, styles.underline(colors.brightRed('replpad')) + colors.yellow(' v' + pkg.version)
, ''
, format(colors.cyan('node') + ' %s', colors.yellow('v' + v.node))
+ format(' | %s | %s cpus | %s platform', colors.green(specs.host), colors.green(specs.cpus), colors.green(specs.platform))
+ format(colors.cyan(' | v8') + ' %s | ' + colors.cyan('uv') + ' %s', colors.yellow('v' + v.v8), colors.yellow('v' + v.uv))
, ''
, 'plugins: ' + plugins
, ''
, 'If in doubt, enter ' + colors.yellow('.help')
, ''
];
module.exports = function (output) {
//msgs.forEach(function (msg) { log.print(msg); });
msgs.forEach(function (msg) { output.write(msg + '\n'); });
};
.on('normal', function () {
prompt = rli._prompt;
rli._prompt = colors.brightRed(prompt);
rli.prompt(true);
})
.on('insert', function () {