Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
messageBox: function(logs: string[], opts?: {color?: string, margin?: number}) {
if (env === "test") return;
process.stdout.write(boxen(
logs.reduce((msg, log) => msg + log + "\n", ""),
{
borderColor: (opts && opts.color) || "cyan",
align: "center",
padding: 1,
borderStyle: boxen.BorderStyle.Double,
margin: (opts && opts.margin) || 0
// float: "center"
}
) + "\n");
},
incrementalMessageBox: function(
export function formatUpdateMessage(update?: IUpdateCheck) {
if (update) {
const message = `Update available ${chalk.dim(update.version)}${chalk.reset(
" → "
)}${chalk.green(update.latest)} \nRun ${chalk.cyan(
"npm i " + (isInstalledGlobally ? "-g " : "") + update.name
)} to update`;
const boxenOpts: boxen.Options = {
align: "center",
borderColor: "yellow",
borderStyle: boxen.BorderStyle.Round,
margin: 1,
padding: 1
};
return boxen.default(message, boxenOpts);
}
}