How to use the colorette.italic 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 intl-wc / intl / packages / cli / src / commands / init.ts View on Github external
createConfig(srcDir)
    ]);

    if (isGit && hasIgnore) {
        const pattern = /^\.intl\/?\s*$/gm;
        if (!(await inGitIgnore(pattern))) {
            const ignore = '.intl/';
            const header = '# Intl generated schemas (https://intljs.com/docs/schemas)';
            await addToGitIgnore(header, ignore);
        };
    }

    const { language, phrase } = greeting();
    const time = printDuration(Date.now() - startTime);

    console.log(`\n  ${bold(phrase)} ${dim(`(that's "Hello world!" in ${italic(language)})`)}

${green('✔')} Project initialized ${dim(time)}

  ${dim('Next steps:')}
    ${dim(terminalPrompt())} ${green('intl add ')}
    ${dim(terminalPrompt())} ${green(`cd ${srcDir}`)}
`)
}
github mattallty / Caporal.js / lib / help.js View on Github external
_getUsage(cmd) {
    let help = `${c.bold('USAGE')}\n\n     ${c.italic(this._program.bin())} `;
    if (cmd) {
      help += colorize(this._getCommandHelp(cmd));
    } else {
      help += colorize(' [options]');
    }
    return help;
  }
github zamotany / react-slate / packages / react-slate-reflow / src / render / applyStyle.js View on Github external
const applySingleStyle = memoize((key: string, value: string, text: string) => {
  switch (key) {
    case 'fontWeight':
      return value === 'bold' ? colorette.bold(text) : text;
    case 'fontStyle':
      return value === 'italic' ? colorette.italic(text) : text;
    case 'textDecoration': {
      switch (value) {
        case 'line-through':
          return colorette.strikethrough(text);
        case 'underline':
          return colorette.underline(text);
        default:
          return text;
      }
    }
    case 'textTransform': {
      switch (value) {
        case 'uppercase':
          return text.toUpperCase();
        case 'lowercase':
          return text.toLowerCase();
github mattallty / Caporal.js / lib / error / unknown-option.js View on Github external
constructor(option, command, program) {
    const suggestions = getSuggestions(option, command._getLongOptions());
    let msg = `Unknown option ${c.italic(getDashedOption(option))}.`;
    if (suggestions.length) {
      msg += ' Did you mean ' + suggestions.map(
        s => '--' + getBoldDiffString(option, s)
      ).join(' or maybe ') + ' ?';
    }
    super(msg, {option, command}, program);
  }
}
github mattallty / Caporal.js / lib / error / missing-option.js View on Github external
constructor(option, command, program) {
    let msg = `Missing option ${c.italic(getDashedOption(option))}.`;
    super(msg, {option, command}, program);
  }
}
github mattallty / Caporal.js / lib / error / invalid-argument-value.js View on Github external
constructor(arg, value, command, originalError, program) {
    let msg = `Invalid value '${value}' for argument ${c.italic(arg)}.\n   ${originalError.meta.originalError}`;
    super(msg, {arg, command, value}, program);
  }
}
github mattallty / Caporal.js / lib / error / invalid-option-value.js View on Github external
constructor(option, value, command, originalError, program) {
    const displayedValue = typeof value === "boolean" && value === true ? '(empty)' : `'${value}'`
    const originalMessage = originalError.meta.error ? originalError.meta.error.message : ""
    let msg = `Invalid value ${displayedValue} for option ${c.italic(getDashedOption(option))}. ${originalMessage}`;
    super(msg, {option, command, originalError}, program);
  }
}