How to use the ansi-colors.bold function in ansi-colors

To help you get started, we’ve selected a few ansi-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 swissquote / crafty / duplicate.js View on Github external
function renderChain(currentChain) {
    // If it's a lerna dependency, ignore it.
    if (currentChain.filter(item => lernaRegex.test(item)).length) {
        return;
    }

    //currentChain.reverse();
    console.log(currentChain.join(colors.bold(" ← "))); // →
}
github olefredrik / FoundationPress / gulpfile.babel.js View on Github external
function loadConfig() {
  log('Loading config file...');

  if (checkFileExists('config.yml')) {
    // config.yml exists, load it
    log(colors.bold(colors.cyan('config.yml')), 'exists, loading', colors.bold(colors.cyan('config.yml')));
    let ymlFile = fs.readFileSync('config.yml', 'utf8');
    return yaml.load(ymlFile);

  } else if(checkFileExists('config-default.yml')) {
    // config-default.yml exists, load it
    log(colors.bold(colors.cyan('config.yml')), 'does not exist, loading', colors.bold(colors.cyan('config-default.yml')));
    let ymlFile = fs.readFileSync('config-default.yml', 'utf8');
    return yaml.load(ymlFile);

  } else {
    // Exit if config.yml & config-default.yml do not exist
    log('Exiting process, no config file exists.');
    log('Error Code:', err.code);
    process.exit(1);
  }
}
github ampproject / amphtml / build-system / pr-check / single-pass-tests.js View on Github external
* This script builds and tests the AMP runtime in single pass mode.
 * This is run during the CI stage = test; job = single pass tests.
 */

const colors = require('ansi-colors');
const {
  printChangeSummary,
  startTimer,
  stopTimer,
  timedExecOrDie: timedExecOrDieBase,
} = require('./utils');
const {determineBuildTargets} = require('./build-targets');
const {isTravisPullRequestBuild} = require('../common/travis');

const FILENAME = 'single-pass-tests.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
  timedExecOrDieBase(cmd, FILENAME);

function main() {
  const startTime = startTimer(FILENAME, FILENAME);

  if (!isTravisPullRequestBuild()) {
    timedExecOrDie('gulp update-packages');
    timedExecOrDie('gulp dist --fortesting --single_pass');
    timedExecOrDie(
      'gulp integration --nobuild --compiled --single_pass --headless'
    );
  } else {
    printChangeSummary(FILENAME);
    const buildTargets = determineBuildTargets(FILENAME);
    if (
github snipsco / create-snips-action / script.js View on Github external
name,
            description,
            author
        })

        fs.outputFileSync(destinationPath, output)
    })

    console.log(c.bold.green(`Action ${name} created successfully.\n`))
    console.log(`Type ${c.bold(`"cd ${name}"`)} to go to the action root directory followed by ${c.bold('"sh setup.sh"')} to install the dependencies.`)
    console.log(c.bold('\nAvailable commands:'))
    console.log(`- ${c.bold('npm run dev   ')} Automatically rebuilds and run the action on file change.`)
    console.log(`- ${c.bold('npm run build ')} Builds the action in production mode.`)
    console.log(`- ${c.bold('npm run test  ')} Runs the test suite.`)
    console.log(`- ${c.bold('npm run launch')} Runs the action in production mode.`)
    console.log(`- ${c.bold('npm run lint  ')} Performs a linter check.`)
    console.log(`- ${c.bold('npm start     ')} Lints, builds and tests the action.`)
    console.log('')
}
github reactiverse / es4x / es4x-cli / bin / es4x.js View on Github external
function exec(command, args, env, options, callback) {
  const proc = spawn(command, args, {env: env});
  if (args && args.length > 0) {
    const lastArg = args[args.length - 1];
    console.log('Running: ' + c.bold(command) + ' ... ' + c.bold(lastArg));
  } else {
    console.log('Running: ' + c.bold(command));
  }

  proc.stdout.on('data', function (data) {
    if (options.verbose) {
      process.stdout.write(data);
    }
  });

  proc.stderr.on('data', function (data) {
    process.stderr.write(data);
  });

  proc.on('close', function (code) {
    if (code) {
github snipsco / create-snips-action / script.js View on Github external
description,
            author
        })

        fs.outputFileSync(destinationPath, output)
    })

    console.log(c.bold.green(`Action ${name} created successfully.\n`))
    console.log(`Type ${c.bold(`"cd ${name}"`)} to go to the action root directory followed by ${c.bold('"sh setup.sh"')} to install the dependencies.`)
    console.log(c.bold('\nAvailable commands:'))
    console.log(`- ${c.bold('npm run dev   ')} Automatically rebuilds and run the action on file change.`)
    console.log(`- ${c.bold('npm run build ')} Builds the action in production mode.`)
    console.log(`- ${c.bold('npm run test  ')} Runs the test suite.`)
    console.log(`- ${c.bold('npm run launch')} Runs the action in production mode.`)
    console.log(`- ${c.bold('npm run lint  ')} Performs a linter check.`)
    console.log(`- ${c.bold('npm start     ')} Lints, builds and tests the action.`)
    console.log('')
}
github ionic-team / stencil / scripts / build.js View on Github external
cp.stderr.on('data', data => {
            errors.push(`\n${color.bold(color.red(script[0] + ' error:'))}\n\n${data}`);
          });
github padloc / padloc / packages / server / src / manage.ts View on Github external
        .map(([prop, value]) => `${colors.bold(col(prop, w))} ${value}`)
        .join("\n");
github liferay / liferay-js-themes-toolkit / packages / liferay-theme-tasks / lib / upgrade / 6.2 / upgrade.js View on Github external
function getLogHeader(header) {
	const line = new Array(65).join('-');

	return colors.bold('\n' + line + '\n ' + header + '\n' + line + '\n\n');
}

ansi-colors

Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).

MIT
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis