How to use the ansi-colors.magenta 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 ampproject / amphtml / build-system / tasks / check-links.js View on Github external
let deadLinksFoundInFile = false;
      for (const {link, status, statusCode} of results) {
        // Skip links to files that were introduced by the PR.
        if (isLinkToFileIntroducedByPR(link)) {
          continue;
        }
        if (status === 'dead') {
          deadLinksFoundInFile = true;
          log(`[${red('✖')}] ${link} (${red(statusCode)})`);
        } else if (!isTravisBuild()) {
          log(`[${green('✔')}] ${link}`);
        }
      }
      const filename = markdownFiles[index];
      if (deadLinksFoundInFile) {
        log(red('ERROR'), 'Possible dead link(s) found in', magenta(filename));
        return filename;
      }
      log(green('SUCCESS'), 'All links in', magenta(filename), 'are alive.');
    })
    .filter(filenameOrUndef => filenameOrUndef);
github mochajs / mocha / lib / cli / cli.js View on Github external
'Commands:': 'Commands'
    })
    .fail((msg, err, yargs) => {
      debug(err);
      yargs.showHelp();
      console.error(`\n${symbols.error} ${ansi.red('ERROR:')} ${msg}`);
      process.exit(1);
    })
    .help('help', 'Show usage information & exit')
    .alias('help', 'h')
    .version('version', 'Show version number & exit', version)
    .alias('version', 'V')
    .wrap(process.stdout.columns ? Math.min(process.stdout.columns, 80) : 80)
    .epilog(
      `Mocha Resources
    Chat: ${ansi.magenta(gitter)}
  GitHub: ${ansi.blue(repository.url)}
    Docs: ${ansi.yellow(homepage)}
      `
    )
    .parserConfiguration(YARGS_PARSER_CONFIG)
    .config(args)
    .parse(args._);
};
github ivogabe / gulp-typescript / release / reporter.js View on Github external
const showErrorCount = (count, type) => {
        if (count === 0)
            return;
        console.log('TypeScript:', colors.magenta(count.toString()), (type !== '' ? type + ' ' : '') + (count === 1 ? 'error' : 'errors'));
        hasError = true;
    };
    showErrorCount(results.transpileErrors, '');
github vigetlabs / blendid / gulpfile.js / lib / compileLogger.js View on Github external
module.exports = function(err, stats) {
  if(err) throw new PluginError("webpack", err)

  var statColor = stats.compilation.warnings.length < 1 ? 'green' : 'yellow'

  if(stats.compilation.errors.length > 0) {
    stats.compilation.errors.forEach(function(error){
      handleErrors(error)
      statColor = 'red'
    })
  } else {
    var compileTime = prettifyTime(stats.endTime - stats.startTime)
    log(colors[statColor](stats))
    log('Compiled with', colors.cyan('webpack'), 'in', colors.magenta(compileTime))
  }
}
github meeroslav / gulp-inject-partials / src / index.js View on Github external
function log(message) {
	fancyLog(colors.magenta(PLUGIN_NAME), message);
}
github ionic-team / stencil / src / sys / node_next / node-logger.ts View on Github external
magenta(msg: string) {
    return color.magenta(msg);
  }
github NewFuture / miniprogram-build / gulpfile.js View on Github external
.on('unlink', function (file) {
			log(colors.magenta(file) + ' is deleted');
			watchHandler('deleted', file);
		});
github swisspush / apikana / src / generate.js View on Github external
generate: function (source, dest, done) {
        var uiPath = path.resolve(dest, 'ui');
        var apikanaPath = path.resolve(__dirname, '..');
        var privateModules = path.resolve(apikanaPath, 'node_modules');
        var modulesPath = fs.existsSync(privateModules) ? privateModules : path.resolve('node_modules');
        var dependencyPath = path.resolve(params.dependencyPath());

        var apiFile = path.resolve(source, params.api());
        if (!fs.existsSync(apiFile)) {
            log.info('API file ', colors.magenta(source + '/' + params.api()), 'not found, generating one.');
            var apiDir = path.dirname(apiFile);
            var api = {
                swagger: '2.0',
                info: {title: path.basename(path.resolve('')), version: '1.0'},
                paths: [],
                definitions: {$ref: readdir(path.resolve(source, params.models()), apiDir)}
            };
            fse.mkdirsSync(apiDir);
            fs.writeFileSync(apiFile, yaml.stringify(api, 6, 2));
        }

        function readdir(basedir, relativeTo) {
            var res = [];
            readdir(basedir, res);
            return res;
github swisspush / apikana / src / generate-schema.js View on Github external
function schemaInfos(schemas) {
            var deps = path.resolve(dependencyPath);
            var relDeps = normPath(path.relative(path.resolve(dest, 'model/json-schema'), deps));
            var infos = {};
            log.debug('Dependencies:   ', colors.magenta(normPath(deps)));
            for (var name in schemas) {
                var schema = schemas[name];
                //thank you MS for messing around with filenames!
                var filename = normPath(schema.extra.filename);
                var source = filename.toLowerCase().startsWith(normPath(deps).toLowerCase())
                    ? (relDeps + '/json-schema-v3' + path.dirname(filename.substring(deps.length + 3)) + '/') : '';
                infos[name] = {
                    source: source,
                    object: schema.type === 'object' || schema.enum || schema.allOf
                };
                log.debug('Source file:    ', colors.magenta(filename));
                log.debug('- as dependency:', colors.magenta(source + name));
            }
            return infos;
        }
github floatdrop / gulp-watch / index.js View on Github external
function log(event, file) {
		event = event[event.length - 1] === 'e' ? event + 'd' : event + 'ed';

		var msg = [colors.magenta(file.relative), 'was', event];

		if (opts.name) {
			msg.unshift(colors.cyan(opts.name) + ' saw');
		}

		fancyLog.info.apply(null, msg);
	}

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 2 years ago

Package Health Score

74 / 100
Full package analysis