How to use the boxen.default function in boxen

To help you get started, we’ve selected a few boxen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github abmaonline / aemfed / src / messages.ts View on Github external
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);
  }
}

boxen

Create boxes in the terminal

MIT
Latest version published 4 months ago

Package Health Score

82 / 100
Full package analysis