How to use the colors/safe.green 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 osmlab / name-suggestion-index / build_all_names.js View on Github external
function build() {
  console.log('building names_all.json');
  console.time(colors.green('data built'));

  // Start clean
  shell.rm('-f', ['dist/names_all.json']);
  let all = {};

  // process one key at a time to reduce memory footprint
  checkKeys.forEach(k => {
    // count
    console.log(` counting ${k}`);
    let counted = {};
    let handler = new osmium.Handler();
    handler.options({ tagged_nodes_only: true });
    handler.on('node', countEntity);
    handler.on('way', countEntity);
    handler.on('relation', countEntity);
github AlCalzone / node-tradfri-client / maintenance / release.ts View on Github external
`git push origin --tags`,
];
if (argv.dry) {
	console.log(colors.yellow("dry run:") + " I would execute this:");
	for (const command of gitCommands) {
		console.log("  " + command);
	}
} else {
	for (const command of gitCommands) {
		console.log(`executing "${colors.blue(command)}" ...`);
		execSync(command, {cwd: rootDir});
	}
}

console.log("");
console.log(colors.green("done!"));
console.log("");

process.exit(0);
github postmanlabs / postman-runtime / npm / publish-docs.js View on Github external
], function (code) {
        console.info(code ?
            colors.red.bold('\ndocumentation publish failed.') :
            colors.green('\ndocumentation published successfully.'));
        exit(code);
    });
};
github ritz078 / starring / lib / cli.js View on Github external
updateNotifier({pkg}).notify();

function getPackageNames(pkg) {
	const deps = Object.assign({}, pkg.dependencies, pkg.devDependencies);
	return Object.keys(deps);
}

const cli = meow(`
	${colors.green('Usage')}
	  $ ${colors.bold('starring')} ${colors.yellow('[input]')}

	${colors.green('Options')}
	  ${colors.bold.yellow('--all')}  Star all the local packages listed in the package.json from current project. [Default: false]
		${colors.bold.yellow('--global')} Star global packages.

	${colors.green('Examples')}
	  $ ${colors.yellow.bold('starring')}
	  presents UI to select the packages you want to star.
	  $ ${colors.yellow.bold('starring colors')}
	  stars colors npm package on GitHub.
`);

async function handleStarring(token, packageNames, starAll = false) {
	const packageDetails = await getPackageDetails(token, packageNames);
	const starredName = packageDetails.filter(pd => pd.starred).map(pd => pd.name);
	const unStarredPackages = packageDetails.filter(pd => !pd.starred);

	if (!isEmpty(starredName)) {
		if (starAll) {
			console.log(colors.yellow.bold(
				`👍  You have already starred ${colors.cyan(arrayToSentence(starredName))}`
			));
github osmlab / name-suggestion-index / build_docs.js View on Github external
if (dict[k][v][kvnd].tags) {
            dict[k][v][kvnd].tags = sort(obj[kvnd].tags);
        }
    });

    generateIndex(tree, dict);

    Object.keys(dict).forEach(k => {
        let entry = dict[k];
        Object.keys(entry).forEach(v => {
            generatePage(tree, dict, k, v);
        });
    });

    console.timeEnd(colors.green(tree + ' written'));
}
github AhmedAli7O1 / hapi-arch / lib / globals.js View on Github external
'use strict';

const colors = require('colors/safe');

global._ = require('lodash');
global.moment = require('moment');
global.TEST = [];
global.ENV = process.env.NODE_ENV || 'development';

console.log(colors.green(`[ HAPI ARCH ] Environment >> ${ENV}`));
github flow-typed / flow-typed / cli / src / lib / createStub.js View on Github external
try {
    if (version === null) {
      throw new Error(
        "Could not deduce version from node_modules or package.json. " +
        "Please provide an explicit version",
      );
    }
    const filename = await writeStub(
      projectRoot,
      packageName,
      version,
      overwrite,
      files,
    );
    console.log(colors.green("✓\t%s@%s -> %s"), packageName, version, filename);
    if (resolutionError) {
      console.log(
        colors.yellow(
          "\t  Unable to stub all files in '%s', " +
          "so only created a stub for the main module (%s)"
        ),
        packageName,
        resolutionError.message,
      );
    }
    return true;
  } catch (e) {
    console.log(
      colors.red("❌\t%s%s': %s"),
      packageName,
      version ? "@"+version : "",
github opencomponents / oc / src / resources / index.js View on Github external
installCompilerSuccess: (template, compiler, version) =>
        `${green('✔')} Installed ${compiler} [${template} v${version}]`,
      legacyTemplateDeprecationWarning: (legacyType, newType) =>
github ezolenko / rollup-plugin-typescript2 / dist / rollup-plugin-typescript2.es.js View on Github external
TsCache.prototype.getCompiled = function (id, snapshot, transform) {
        var name = this.makeName(id, snapshot);
        this.context.info(blue("transpiling") + " '" + id + "'");
        this.context.debug("    cache: '" + this.codeCache.path(name) + "'");
        if (!this.codeCache.exists(name) || this.isDirty(id, false)) {
            this.context.debug(yellow("    cache miss"));
            var transformedData = transform();
            this.codeCache.write(name, transformedData);
            this.markAsDirty(id);
            return transformedData;
        }
        this.context.debug(green("    cache hit"));
        var data = this.codeCache.read(name);
        this.codeCache.write(name, data);
        return data;
    };
    TsCache.prototype.getSyntacticDiagnostics = function (id, snapshot, check) {
github aws / aws-cdk / packages / aws-cdk-toolkit / lib / init.ts View on Github external
function printAvailableTemplates() {
    print('Available templates:');
    for (const template of availableInitTemplates) {
        print(`* ${colors.green(template.name)}: ${template.description}`);
        print(`   └─ ${colors.blue(`cdk init --type=${template.name} --language=[${template.languages.join('|')}]`)}`);
    }
}