How to use the chalk.cyan function in chalk

To help you get started, we’ve selected a few chalk 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 blockchain-IoT / Motoro / scripts / start.js View on Github external
return function (err, req, res) {
    const host = req.headers && req.headers.host;
    console.log(`${chalk.red('Proxy error:')} Could not proxy request ${chalk.cyan(req.url)
    } from ${chalk.cyan(host)} to ${chalk.cyan(proxy)}.`);
    console.log(`See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (${
      chalk.cyan(err.code)}).`);
    console.log();

    // And immediately send the proper error response to the client.
    // Otherwise, the request will eventually timeout with ERR_EMPTY_RESPONSE on the client side.
    if (res.writeHead && !res.headersSent) {
      res.writeHead(500);
    }
    res.end(`Proxy error: Could not proxy request ${req.url} from ${
      host} to ${proxy} (${err.code}).`);
  };
}
github garden-io / garden / garden-service / src / commands / run / service.ts View on Github external
async action({ garden, log, headerLog, args, opts }: CommandParams): Promise> {
    const serviceName = args.service
    const graph = await garden.getConfigGraph(log)
    const service = await graph.getService(serviceName)
    const module = service.module

    printHeader(headerLog, `Running service ${chalk.cyan(serviceName)} in module ${chalk.cyan(module.name)}`, "runner")

    const actions = await garden.getActionRouter()

    // Make sure all dependencies are ready and collect their outputs for the runtime context
    const deployTask = new DeployTask({
      force: true,
      forceBuild: opts["force-build"],
      garden,
      graph,
      log,
      service,
    })
    const dependencyResults = await garden.processTasks(await deployTask.getDependencies())

    const dependencies = await graph.getDependencies("deploy", serviceName, false)
    const serviceStatuses = getServiceStatuses(dependencyResults)
github node-opcua / node-opcua / packages / node-opcua-secure-channel / source / client / client_secure_channel_layer.ts View on Github external
this.__call = 0;
            return this._connect(transport, endpointUrl, callback);
        }

        const connectFunc = (callback2: ErrorCallback) => {
            return this._connect(transport, endpointUrl, callback2);
        };
        const completionFunc = (err?: Error) => {
            return this._backoff_completion(err, this.lastError, transport, callback);
        };

        this.__call = backoff.call(connectFunc, completionFunc);

        if (this.connectionStrategy.maxRetry >= 0) {
            const maxRetry = Math.max(this.connectionStrategy.maxRetry, 1);
            debugLog(chalk.cyan("backoff will failed after "), maxRetry);
            this.__call.failAfter(maxRetry);
        } else {
            // retry will be infinite
            debugLog(chalk.cyan("backoff => starting a infinite retry"));
        }

        const onBackoffFunc = (retryCount: number, delay: number) => {
            debugLog(chalk.bgWhite.cyan(" Backoff #"), retryCount, "delay = ", delay,
                " ms", " maxRetry ", this.connectionStrategy.maxRetry);
            // Do something when backoff starts, e.g. show to the
            // user the delay before next reconnection attempt.
            /**
             * @event backoff
             * @param retryCount: number
             * @param delay: number
             */
github trustworktech / create-react-ssr-app / packages / create-react-ssr-app / createReactSsrApp.js View on Github external
'react-ssr-scripts',
        ],
        npmGlobalPackages: ['create-react-ssr-app'],
      },
      {
        duplicates: true,
        showNotFound: true,
      }
    )
    .then(console.log);
}

if (typeof projectName === 'undefined') {
  console.error('Please specify the project directory:');
  console.log(
    `  ${chalk.cyan(program.name())} ${chalk.green('')}`
  );
  console.log();
  console.log('For example:');
  console.log(
    `  ${chalk.cyan(program.name())} ${chalk.green('my-react-ssr-app')}`
  );
  console.log();
  console.log(
    `Run ${chalk.cyan(`${program.name()} --help`)} to see all options.`
  );
  process.exit(1);
}

function printValidationResults(results) {
  if (typeof results !== 'undefined') {
    results.forEach(error => {
github jpkli / p4 / build / build.js View on Github external
if (err) throw err
  
  process.stdout.write(stats.toString({
    colors: true,
    modules: false,
    children: false,
    chunks: false,
    chunkModules: false
  }) + '\n\n')

  if (stats.hasErrors()) {
    console.log(chalk.red('  Build failed with errors.\n'))
    process.exit(1)
  }

  console.log(chalk.cyan('  Build complete.\n'))

  let dir = path.resolve(__dirname, "../dist")
  let version = npmPackage.version
  fs.copyFile(path.join(dir, 'p4.js'), path.join(dir, 'p4.v' + version + '.js'), (err) => {
    if (err) throw err;
    console.log('dist file: ', 'p4.v' + version + '.js');
  })
})
github ItzBlitz98 / torrentflix / lib / main.js View on Github external
var size = torrent.size;
            var seed = torrent.seeds;
            var leech = torrent.leechs;
            var torrent_verified = " ";

            if(torrent.torrent_verified) {
                torrent_verified = torrent.torrent_verified;
                if(torrent.torrent_verified == "vip"){
                  torrent_verified = chalk.green(" πŸ’€  ");
                } else if(torrent.torrent_verified == "trusted"){
                  torrent_verified = chalk.magenta(" πŸ’€  ");
                }
            }

            if(conf_date_added == "true"){
              date_added = chalk.cyan("" + torrent.date_added + " ");
            } else {
              date_added = "";
            }

            if(history == "true"){
              var found = searchHistory(torrent.title);
              if(found){
                 title = chalk.red(torrent.title);
               } else {
                 title = chalk.yellow(torrent.title);
               }
            } else {
              title = chalk.yellow(torrent.title);
            }
            console.log(
              chalk.magenta(number) + chalk.magenta('\) ') + title + chalk.green(torrent_verified) + date_added + chalk.blue(size) + (' ') + chalk.green(seed) + (' ') + chalk.red(leech)
github bevacqua / grunt-ec2 / tasks / ec2_deploy_many.js View on Github external
grunt.registerTask('ec2-deploy-many', 'Deploys multiple Instances', function (name) {
        conf.init(grunt);

        if (arguments.length === 0) {
            grunt.fatal([
                'You should provide an instance name.',
                'e.g: ' + chalk.yellow('grunt ec2-deploy-many:name')
            ].join('\n'));
        }

        var done = this.async();
        var params = {
            Filters: [{ Name: 'tag:Name', Values: [name] }]
        };

        grunt.log.writeln('Getting EC2 description for %s instance...', chalk.cyan(name));

        aws.log('ec2 describe-instances --filters Name=tag:Name,Values=%s', name);
        aws.ec2.describeInstances(params, aws.capture(function (result) {
            var instances = _.pluck(result.Reservations, 'Instances');
            var flat = _.flatten(instances);

            var instanceNames = [];
            for (var i = 0; i < flat.length; i++) {
                instanceNames.push(flat[i]['Tags'][0]['Value']);
            }

            grunt.log.writeln('Deploying to instances: %s', chalk.cyan(instanceNames));

            for (var j = 0; j < instanceNames.length; j++) {
                grunt.task.run('ec2-deploy:' + instanceNames[i]);
            }
github TryGhost / Ghost / gulpfile.js View on Github external
gulp.task('_checkout:admin', function (cb) {
    if (gitBranches.admin.gitCommand) {
        console.info(chalk.cyan('Checking out ') + chalk.red('"' + gitBranches.admin.branch + '" ') + chalk.cyan('on Ghost-Admin...'));
        exec('cd ' + paramConfig.admin.path + ' && ' + gitBranches.admin.gitCommand, function (err, stdout, stderr) {
            if (!stdout) {
                console.info(chalk.red(stderr));
            } else {
                console.info(chalk.green(stdout) + '\n ' + chalk.red(stderr));
            }
            if (err) {swallowError(err, false);}
            cb();
        });
    } else {
        cb();
    }
});
github ngageoint / geopackage-js / optimizer / index.js View on Github external
console.log(chalk.cyan('Table Name: ') + info.contents.tableName);
  console.log(chalk.cyan('Data Type: ') + info.contents.dataType);
  console.log(chalk.cyan('Identifier: ') + info.contents.identifier);
  console.log(chalk.cyan('Description: ') + info.contents.description);
  console.log(chalk.cyan('Last Change: ') + info.contents.lastChange);
  console.log(chalk.cyan('Min X: ') + info.contents.minX);
  console.log(chalk.cyan('Min Y : ') + info.contents.minY);
  console.log(chalk.cyan('Max X: ') + info.contents.maxX);
  console.log(chalk.cyan('Max Y: ') + info.contents.maxY);

  console.log('\n\t'+chalk.cyan('Contents Spatial Reference System'));
  console.log('\t'+chalk.cyan('SRS Name: ') + info.contents.srs.count);
  console.log('\t'+chalk.cyan('SRS ID: ') + info.contents.srs.id);
  console.log('\t'+chalk.cyan('Organization: ') + info.contents.srs.organization);
  console.log('\t'+chalk.cyan('Coordsys ID: ') + info.contents.srs.organization_coordsys_id);
  console.log('\t'+chalk.cyan('Definition: ') + info.contents.srs.definition);
  console.log('\t'+chalk.cyan('Description: ') + info.contents.srs.description);
  return info;
}
github form-o-fill / form-o-fill-chrome-extension / gulpfile.js View on Github external
gulp.task('announce', function() {
  plugins.util.log(
    'Building version', chalk.cyan(manifest.version),
    'of', chalk.cyan(manifest.name),
    'as', chalk.cyan("dist/" + distFilename)
  );
});