How to use the colors/safe.yellow function in colors

To help you get started, we’ve selected a few colors 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 schovi / create-chrome-extension / src / build.js View on Github external
exec(command, (error, stdout, stderr) => {
          if(stdout) {
            console.log(color.yellow('stdout: ' + stdout));
          }

          if(stderr) {
            return reject('stderr: ' + stderr)
          }

          if(error !== null) {
            return reject('exec error: ' + stderr)
          }

          resolve(`Extension builded in '${options.release}'`)
        })
        // Long enought to prevent some unexpected errors
github isuttell / grunt-flow-type-check / tasks / lib / style.js View on Github external
// Error Line/Position
    errors.push(colors.yellow(error.message[0].line.toString()) + ',');
    errors.push(colors.cyan(error.message[0].start.toString()) + ',');
    errors.push(colors.cyan(error.message[0].end.toString()) + ': ');

    // Error Message - Split so we can color multiple lines
    descr = error.message[0].descr.split('\n');
    descr.forEach(function(item) {
      errors.push(colors.red(item) + '\n');
    });

    // Some messages have a second line notifying where the error is
    if (error.message.length === 2) {
      errors.push('  ' + colors.green(path || error.message[1].path) + ':');

      errors.push(colors.yellow(error.message[1].line.toString()) + ',');
      errors.push(colors.cyan(error.message[1].start.toString()) + ',');
      errors.push(colors.cyan(error.message[1].end.toString()) + ': ');

      errors.push(colors.green(error.message[1].descr) + '\n');
    }

    errors.push('\n');
  });
github apache / incubator-weex-cli / lib / cli.js View on Github external
}
  }

  if (needInstall) {
    try {
      await install(coreName, coreVersion, {
        root: config.coreRoot,
        trash: config.trash,
        force: argv.force || argv.f,
        registry: config.registry,
        ENVS: config.ENVS,
      });
    } catch (error) {
      if (error.stack.indexOf('module is locked') >= 0) {
        console.error(colors.red('\nThe module is locked, please check if there has another installing process.'))
        console.log(`Or you can run the command with ${colors.yellow('`-f`')} or ${colors.yellow('`--force`')} option to skip it.`)
        process.exit(0)
      }
    }
    const packageJson = await fse.readJson(path.join(config.coreRoot, 'node_modules', coreName, 'package.json'))
    let userConfigs = {}
    if (typeof config.telemetry === 'undefined') {
      userConfigs = await initGlobalConfig()
    }
    coreConfigurations = Object.assign({
      version: packageJson.version,
      name: packageJson.name,
      is_next: true,
      next_version: '',
      local: path.join(config.coreRoot, 'node_modules', coreName),
      last_update_time: (new Date()).getTime(),
      update_time: 7
github sebastian-software / edgestack / src / webpack / util.js View on Github external
{
  const title = `${options.title.toUpperCase()}`

  if (options.notify) {
    notifier.notify({
      title,
      message: options.message
    })
  }

  const level = options.level || "info"
  const message = `==> ${title} -> ${options.message}`

  switch (level) {
    case "warn":
      console.log(colors.yellow(message))
      break

    case "error":
      console.log(colors.bgRed.white(message))
      break

    case "info":
    default:
      console.log(colors.green(message))
  }
}
github mikemintz / rethinkdb-websocket-server / src / Connection.js View on Github external
log(msg, token) {
    const time = colors.blue(moment().format('HH:mm:ss.SSS'));
    const addr = colors.gray(this.remoteAddress + ':' + this.remotePort);
    const tokenStr = token ? colors.yellow(`tkn=${token} `) : '';
    console.log(`${time} ${addr} ${tokenStr}${msg}`);
  }
github mattias800 / react-native-relay-facebook-neo4j-starter-kit / graphql / src / persistence / neo4j / Neo4jConnector.js View on Github external
function logQuery(start, end, query, params) {
    console.log(
        `--- DB-query ${end.getTime() - start.getTime()}ms
${colors.blue(reformatQuery(query))}
${colors.yellow(JSON.stringify(params) || "")}`
    );
}
github openstreetmap / iD / build_css.js View on Github external
function buildCSS() {
  if (_currBuild) return _currBuild;

  const START = '🏗   ' + colors.yellow('Building css...');
  const END = '👍  ' + colors.green('css built');

  console.log('');
  console.log(START);
  console.time(END);

  return _currBuild =
    Promise.resolve()
    .then(() => doGlob('css/**/*.css'))
    .then((files) => doConcat(files, 'dist/iD.css'))
    .then(() => {
      console.timeEnd(END);
      console.log('');
      _currBuild = null;
    })
    .catch((err) => {
github material-components / material-components-web / scripts / lint-mdc.ts View on Github external
function run() {
  const inputFilePaths = glob.sync(path.join(PACKAGES_DIR_ABSOLUTE, '**/*.ts'), {
    ignore: ['**/node_modules/**', '**/dist/**', '**/*.d.ts', '**/test/*.ts'],
    nodir: true,
  });

  const mdcLinterAnsi = colors.bold(colors.yellow('MDC Linter'));
  console.log(`\n${mdcLinterAnsi}: Checking ${inputFilePaths.length.toLocaleString()} TypeScript files...\n`);

  lintAllFiles(inputFilePaths);

  const plural = violationCount === 1 ? '' : 's';
  const violationCountBold = colors.bold(violationCount.toLocaleString());
  const violationCountColor = violationCount > 0 ? colors.red(violationCountBold) : colors.green(violationCountBold);
  console.log(`${mdcLinterAnsi}: Found ${violationCountColor} error${plural}\n`);
}
github ArnoldZokas / grunt-ssh-multi-exec / tasks / ssh-multi-exec.js View on Github external
                logger.write(shellPrefix, input, function(x) { return colors.yellow(x); });