How to use the colorette.red 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 knex / knex / bin / utils / cli-config-utils.js View on Github external
function exit(text) {
  if (text instanceof Error) {
    console.error(
      color.red(`${text.detail ? `${text.detail}\n` : ''}${text.stack}`)
    );
  } else {
    console.error(color.red(text));
  }
  process.exit(1);
}
github knex / knex / bin / utils / cli-config-utils.js View on Github external
function resolveEnvironmentConfig(opts, allConfigs) {
  const environment = opts.env || process.env.NODE_ENV || 'development';
  const result = allConfigs[environment] || allConfigs;

  if (allConfigs[environment]) {
    console.log('Using environment:', color.magenta(environment));
  }

  if (!result) {
    console.log(color.red('Warning: unable to read knexfile config'));
    process.exit(1);
  }

  if (argv.debug !== undefined) {
    result.debug = argv.debug;
  }

  return result;
}
github TankerHQ / sdk-js / config / rollup-plugin-copy-edit.js View on Github external
const fatal = (src, dest, err) => {
  console.error(`(${name}) '${red(src)}' -> '${red(dest)}' (${red(cross)})`);
  console.error(`\n    ${err}\n`);
  process.exit(err.errno);
};
github knex / knex / bin / utils / cli-config-utils.js View on Github external
function exit(text) {
  if (text instanceof Error) {
    console.error(
      color.red(`${text.detail ? `${text.detail}\n` : ''}${text.stack}`)
    );
  } else {
    console.error(color.red(text));
  }
  process.exit(1);
}
github okwolf / create-hyperapp / bin / index.js View on Github external
const exitWithError = error => {
  process.stderr.write(`${bold(red(error))}\n\n`);
  process.exit(1);
};
github saojs / kopy / lib / logger.js View on Github external
error(...args) {
    if (this.options.logLevel < 1) {
      return
    }
    process.exitCode = process.exitCode || 1
    console.error(colors.red('error'), ...args)
  }
github makuga01 / dnsFookup / FE / node_modules / autoprefixer / lib / autoprefixer.js View on Github external
if (!options) {
    options = {};
  }

  if (options.browser) {
    throw new Error('Change `browser` option to `overrideBrowserslist` in Autoprefixer');
  } else if (options.browserslist) {
    throw new Error('Change `browserslist` option to `overrideBrowserslist` in Autoprefixer');
  }

  if (options.overrideBrowserslist) {
    reqs = options.overrideBrowserslist;
  } else if (options.browsers) {
    if (typeof console !== 'undefined' && console.warn) {
      if (colorette.red) {
        console.warn(colorette.red(WARNING.replace(/`[^`]+`/g, function (i) {
          return colorette.yellow(i.slice(1, -1));
        })));
      } else {
        console.warn(WARNING);
      }
    }

    reqs = options.browsers;
  }

  var brwlstOpts = {
    ignoreUnknownVersions: options.ignoreUnknownVersions,
    stats: options.stats
  };

  function loadPrefixes(opts) {
github mattallty / Caporal.js / lib / error / base-error.js View on Github external
constructor(message, meta, program) {
    const spaces = " ".repeat(3);
    const msg = spaces + c.red("Error: " + message) + "\n" + spaces +
                `Type ${c.bold(program.bin() + ' --help')} for help.\n`;
    super(msg);
    this.name = this.constructor.name;
    this.originalMessage = message;
    this.meta = meta;
    Error.captureStackTrace(this, this.constructor);
  }
}