How to use the colorette.bold function in colorette

To help you get started, we’ve selected a few colorette 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 solid / node-solid-server / bin / lib / cli-utils.js View on Github external
function loadConfig (program, options) {
  let argv = {
    ...options,
    version: program.version()
  }
  let configFile = argv['configFile'] || './config.json'

  try {
    const file = fs.readFileSync(configFile)

    // Use flags with priority over config file
    const config = JSON.parse(file)
    argv = { ...config, ...argv }
  } catch (err) {
    // No file exists, not a problem
    console.log(cyan(bold('TIP')), 'create a config.json: `$ solid init`')
  }

  return argv
}
github mattallty / Caporal.js / lib / help.js View on Github external
_getCommands() {
    const commandTable = this._getSimpleTable();
    this._program._commands
      // don't include default command
      .filter((c) => c.name() !== '' && c.visible())
      .forEach(cmd => {
        commandTable.push(
          [c.magenta(cmd.getSynopsis()), cmd.description()]
        );
      });
    commandTable.push([c.magenta('help '), 'Display help for a specific command']);
    return c.bold('COMMANDS') + "\n\n" + colorize(commandTable.toString());
  }
github Ovyerus / micro-link / scripts / generateToken.js View on Github external
if (alreadyGenerated) await query`UPDATE redirect_keys SET content = ${hash}`;
  else await query`INSERT INTO redirect_keys (content) VALUES (${hash})`;

  await clipboardy.write(mnemonic);

  storeSpinner.succeed();

  console.log();
  console.log(
    c.green('√ '),
    'Your passphrase has been stored, and is now ready to use when micro-link is deployed!',
    '\n'
  );
  console.log('  ', c.green('Your passphrase is:'));
  console.log('    ', c.bold(mnemonic));
  console.log('\n  ', c.green('It has also been copied to your clipboard.'));

  process.exit(0);
}
github doowb / ansi-colors / examples / nesting-bug.js View on Github external
console.log();

const { bold, cyan, gray, green, red, symbols } = require('./');
const good = green(symbols.check);
const bad = red(symbols.cross);

console.log(bold(`foo ${cyan.dim('bar')} baz`), good, gray('(ansi-colors)'));

const colorette = require('colorette');
console.log(colorette.bold(`foo ${colorette.cyan(colorette.dim('bar'))} baz`), bad, gray('(colorette)'));

const kleur = require('kleur');
console.log(kleur.bold(`foo ${kleur.cyan.dim('bar')} baz`), bad, gray('(kleur)'));

const chalk = require('chalk');
console.log(chalk.bold(`foo ${chalk.cyan.dim('bar')} baz`), bad, gray('(chalk)'));

console.log();
github Ovyerus / micro-link / scripts / generateToken.js View on Github external
async function main() {
  if (!hasEnvVars) {
    console.log(
      c.red(
        c.bold(
          'It looks like you are missing the environment variables required for the script to run.'
        )
      )
    );
    console.log(
      c.red(
        c.bold(
          'Try adding them in a `.env` file, or adding them directly to your environment variables.'
        )
      )
    );
    console.log(
      c.red(
        c.bold(
          'For information on the required environment variables, refer to the env section of `now.json`.'
        )
github mattallty / Caporal.js / lib / help.js View on Github external
help += this._renderHelp(cmd._name);

    if (args.length) {
      help += `\n\n   ${c.bold('ARGUMENTS')}\n\n`;
      const argsTable = this._getSimpleTable();
      args.forEach(a => {
        const def = a.hasDefault() ? 'default: ' + JSON.stringify(a.default()) : '';
        const req = a.isRequired() ? c.bold('required') : c.gray('optional');
        argsTable.push([a.synopsis(), a.description(), req, c.gray(def)])
      });
      help += argsTable.toString();
    }

    if (options.length) {
      help += `\n\n   ${c.bold('OPTIONS')}\n\n`;
      const optionsTable = this._getSimpleTable();
      options.forEach(a => {
        const def = a.hasDefault() ? 'default: ' + JSON.stringify(a.default()) : '';
        const req = a.isRequired() ? c.bold('required') : c.gray('optional');
        optionsTable.push([a.synopsis(), a.description(), req, c.gray(def)])
      });
      help += optionsTable.toString();
    }

    return help;
  }
github mattallty / Caporal.js / lib / help.js View on Github external
_getCommandHelp(cmd) {
    const args = cmd.args();
    const options = cmd.options();
    let help = (cmd.name() ? cmd.name() + ' ' : '') + args.map(a => a.synopsis()).join(' ');

    help += this._renderHelp(cmd._name);

    if (args.length) {
      help += `\n\n   ${c.bold('ARGUMENTS')}\n\n`;
      const argsTable = this._getSimpleTable();
      args.forEach(a => {
        const def = a.hasDefault() ? 'default: ' + JSON.stringify(a.default()) : '';
        const req = a.isRequired() ? c.bold('required') : c.gray('optional');
        argsTable.push([a.synopsis(), a.description(), req, c.gray(def)])
      });
      help += argsTable.toString();
    }

    if (options.length) {
      help += `\n\n   ${c.bold('OPTIONS')}\n\n`;
      const optionsTable = this._getSimpleTable();
      options.forEach(a => {
        const def = a.hasDefault() ? 'default: ' + JSON.stringify(a.default()) : '';
        const req = a.isRequired() ? c.bold('required') : c.gray('optional');
        optionsTable.push([a.synopsis(), a.description(), req, c.gray(def)])