How to use the chalk.blue 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 elastic / eui / scripts / release.js View on Github external
if (hasBugFixes && !hasFeaturesWithBugFixes) {
    // there are bug fixes with no minor features
    recommendedType = TYPE_PATCH;
  }

  if (hasBreakingChanges) {
    // detected breaking changes
    recommendedType = TYPE_MAJOR;
  }

  const humanReadableRecommendation = humanReadableTypes[recommendedType];
  console.log(chalk.magenta('Detected the following unreleased changes from CHANGELOG.md'));
  console.log('');
  console.log(chalk.gray(unreleasedchanges));
  console.log('');
  console.log(`${chalk.magenta('The recommended version update for these changes is')} ${chalk.blue(humanReadableRecommendation)}`);
  console.log(`${chalk.magenta('What part of the package version do you want to bump?')} ${chalk.gray('(major, minor, patch)')}`);

  return await promptUserForVersionType();
}
github beakerbrowser / bkr / lib / usage.js View on Github external
${chalk.bold(`clone`)}  ${chalk.gray(`[--cached] [directory]`)} - copy a dat into a dir
  ${chalk.bold(`pull`)} ${chalk.gray(`[--live] [directory]`)} - pull the latest version of a dat

${chalk.bold(`Open in beaker:`)}

  ${chalk.bold(`open`)} ${chalk.gray(`[directory]`)} - open the dat in a folder
  ${chalk.bold(`dev`)} ${chalk.gray(`[directory]`)} - create and open a temporary live-watching dat

${chalk.bold(`Management:`)}

  ${chalk.bold(`ls`)} ${chalk.gray(`[--mine]`)} - list dats saved in beaker
  ${chalk.bold(`save`)}  - save a dat to beaker
  ${chalk.bold(`unsave`)}  - unsave a dat from beaker

  ${chalk.blue(`Learn more at https://github.com/beakerbrowser/bkr`)}
`)
  process.exit(err ? 1 : 0)
}
github albinotonnina / javascript-data-structures-and-algorithms / src / utils / create-unit.js View on Github external
const render = (options, template, out) => {
  const argumentsArr =
    options.arguments.length > 0 ? options.arguments.split(',') : []

  const args =
    argumentsArr.length > 0
      ? argumentsArr.length > 1 ? `(${options.arguments})` : options.arguments
      : '()'

  const extendedOptions = Object.assign({}, options, {
    arguments: args
  })
  chalk.blue(extendedOptions)
  const input = path.join(templates, template)
  const output = path.join(src, options.destination, options.name, out)

  const code = ejs.render(fs.readFileSync(input, 'utf8'), extendedOptions)
  fs.writeFileSync(output, code)
}
github dthree / wat / src / vorpal / proxy.js View on Github external
const questions = [{
        type: 'input',
        name: 'address',
        message: chalk.blue('  proxy address: ')
      }, {
        type: 'input',
        name: 'port',
        message: chalk.blue('  proxy port: ')
      }, {
        type: 'input',
        name: 'user',
        message: chalk.blue(`  user ${chalk.grey(`(optional)`)}: `)
      }, {
        type: 'input',
        name: 'pass',
        message: chalk.blue(`  pass ${chalk.grey(`(optional)`)}: `)
      }];
      this.prompt(questions, function (data) {
        app.clerk.prefs.set('proxy', 'on');
        app.clerk.prefs.set('proxy-address', data.address);
        app.clerk.prefs.set('proxy-port', data.port);
        app.clerk.prefs.set('proxy-user', data.user);
        app.clerk.prefs.set('proxy-pass', data.pass);
        self.log('\n  Great! Try out your connection.\n');
        cb();
      });
    });
github validitylabs / hopr / hopr.js View on Github external
async function openChannels() {
    let str = `${chalk.yellow('ChannelId:'.padEnd(64, ' '))} - ${chalk.blue('PeerId:')}\n`

    try {
        str += await node.paymentChannels.getAllChannels(
            channel => {
                if (!channel.state.counterparty)
                    return `${chalk.yellow(channel.channelId.toString('hex'))} - ${chalk.gray('pre-opened')}`

                return pubKeyToPeerId(channel.state.counterparty).then(
                    peerId => `${chalk.yellow(channel.channelId.toString('hex'))} - ${chalk.blue(peerId.toB58String())}`
                )

            },
            promises => {
                if (promises.length == 0) return `\n  No open channels.`

                return Promise.all(promises).then(results => results.join('\n'))
github vuepress-reco / theme-cli / src / reco-build.ts View on Github external
function changePackage (choices: Choices) {
  spinner.start(chalk.blue(`[${currentStep}/${stepNum}] Edit package.json`))

  return new Promise((resolve) => {
    fs.readFile(`${process.cwd()}/${program.init}/package.json`, (err: Object, data: Object) => {
      if (err) throw err
      const _data = JSON.parse(data.toString())
      _data.name = program.init
      _data.description = choices.description
      _data.version = '1.0.0'
      const str = JSON.stringify(_data, null, 2)
      fs.writeFile(`${process.cwd()}/${program.init}/package.json`, str, function (err: Object) {
        if (!err) {
          spinner.succeed(chalk.blue(`[${currentStep}/${stepNum}] Edit package.json`))
          currentStep++
          resolve()
        } else {
          spinner.fail(chalk.blue(`[${currentStep}/${stepNum}] Edit package.json`))
github NERC-CEH / datalab / code / workspaces / infrastructure-api / src / stacks / stackBuilders.js View on Github external
.then((manifest) => {
      logger.info(`Creating deployment ${chalk.blue(deploymentName)} with manifest:`);
      logger.debug(manifest.toString());
      return deploymentApi.createOrUpdateDeployment(deploymentName, projectKey, manifest);
    });
};
github chrisdmacrae / atomic-algolia / lib / update.js View on Github external
"use strict";

require("source-map-support/register");

var actionAdd = require("./utils/actionAdd");
var actionUpdate = require("./utils/actionUpdate");
var actionDelete = require("./utils/actionDelete");
var algoliaSearch = require("algoliasearch");
var chalk = require("chalk");
var dotenv = require("dotenv").config();
var fs = require("fs");
var getLocalIndex = require("./utils/getLocalIndex");
var getRemoteIndex = require("./utils/getRemoteIndex");
var calculateOperations = require("./utils/calculateOperations");
var title = "[" + chalk.blue("Algolia") + "]";

module.exports = function update(indexName, indexData, options, cb) {
    try {
        if (!indexName) throw new Error("Please provide `indexName`");

        if (!indexData) throw new Error("Please provide `indexData`. A valid Javacript object or path to a JSON file.");

        if (typeof options === "function" && typeof cb !== "function") {
            cb = options;
        }

        var client = algoliaSearch(process.env.ALGOLIA_APP_ID, process.env.ALGOLIA_ADMIN_KEY);

        var index = client.initIndex(indexName);
        var newIndex = getLocalIndex(indexData);
github Siteimprove / alfa / packages / alfa-bench / src / benchmark.ts View on Github external
})
  );

  output += " ops/sec";

  output += chalk.gray(" ±");

  output += (margin > 5 ? chalk.red : margin > 2 ? chalk.yellow : chalk.green)(
    margin.toLocaleString("en", {
      style: "decimal",
      useGrouping: false,
      minimumFractionDigits: 2
    })
  );

  output += chalk.blue("%");

  output += chalk.gray(
    ` (${samples} ${samples === 1 ? "run" : "runs"} sampled)`
  );

  return output;
}
github kaz / showcase / lib / helper / logger.js View on Github external
const hr = message => print(chalk.blue(`---------- ${message} ----------`));