How to use the chalk.bold 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 node-machine / machinepack / bin / machinepack-info.js View on Github external
console.log();
      console.log();
    }

    console.log(chalk.bold('INSTALLATION'));
    // console.log();
    console.log(chalk.white(util.format('     npm install %s@^%s --save %s',
      chalk.bold(machinepack.npmPackageName),
      machinepack.version,
      (machinepack.usesPublicRegistry === false) ? '--registry=' + machinepack.registry : ''
    )));

    console.log();
    console.log();

    console.log(chalk.bold('USAGE'));
    // console.log();
    console.log('     var ' + machinepack.variableName + ' = require(\'' + machinepack.npmPackageName + '\');');
    console.log();
    console.log();

    console.log(chalk.bold('AVAILABLE METHODS'));
    // console.log();

    if (machinepack.machines.length < 1) {
      console.log(chalk.gray('     none'));
    } else {
      // console.log('%s %s:', chalk.bold(chalk.blue(machinepack.machines.length)), machinepack.machines.length===1?'Machine':'Machines');
      _.each(machinepack.machines.sort(), function(machineIdentity) {
        // Calculate appropriate machine method name
        var methodName = Javascript.convertToEcmascriptCompatibleVarname({
          string: machineIdentity,
github weex-templates / webpack / template / configs / webpack.release.conf.js View on Github external
const commonConfig = require('./webpack.common.conf');
const webpackMerge = require('webpack-merge'); // used to merge webpack configs
// tools
const ip = require('ip').address();
const os = require('os');
const chalk = require('chalk');
const path = require('path');
const webpack = require('webpack');
const helper = require('./helper');
const config = require('./config');

console.log(`${chalk.green(`Package web project at ${chalk.bold(path.resolve('./release/web'))}!`)}`)
/**
 * Webpack Plugins
 */
const UglifyJsparallelPlugin = require('webpack-uglify-parallel');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');

/**
 * Generate multiple entrys
 * @param {Array} entry 
 */
const generateMultipleEntrys = (entry) => {
  let entrys = Object.keys(entry);
  // exclude vendor entry.
  entrys = entrys.filter(entry => entry !== 'vendor' );
  const htmlPlugin = entrys.map(name => {
github leecade / react-native-swiper / examples / node_modules / react-native / packager / packager.js View on Github external
process.on('uncaughtException', function(e) {
  if (e.code === 'EADDRINUSE') {
    console.log(
      chalk.bgRed.bold(' ERROR '),
      chalk.red('Packager can\'t listen on port', chalk.bold(options.port))
    );
    console.log('Most likely another process is already using this port');
    console.log('Run the following command to find out which process:');
    console.log('\n  ', chalk.bold('lsof -n -i4TCP:' + options.port), '\n');
    console.log('You can either shut down the other process:');
    console.log('\n  ', chalk.bold('kill -9 '), '\n');
    console.log('or run packager on different port.');
  } else {
    console.log(chalk.bgRed.bold(' ERROR '), chalk.red(e.message));
    var errorAttributes = JSON.stringify(e);
    if (errorAttributes !== '{}') {
      console.error(chalk.red(errorAttributes));
    }
    console.error(chalk.red(e.stack));
  }
  console.log('\nSee', chalk.underline('http://facebook.github.io/react-native/docs/troubleshooting.html'));
  console.log('for common problems and solutions.');
  process.exit(1);
});
github GetStream / stream-cli / src / commands / chat / user / mute.js View on Github external
required: true,
					},
				]);

				flags.user = res.user;
			}

			const client = await chatAuth(this);
			const response = await client.muteUser(flags.user, 'CLI');

			if (flags.json) {
				this.log(JSON.stringify(response));
				this.exit();
			}

			this.log(`User ${chalk.bold(flags.user)} has been muted.`);
			this.exit();
		} catch (error) {
			await this.config.runHook('telemetry', {
				ctx: this,
				error,
			});
		}
	}
}
github zeit / now / bin / now-scale.js View on Github external
function printScaleingRules(url, currentReplicas, min, max, elapsed) {
  const log = console.log
  success(
    `Configured scaling rules ${chalk.gray(elapsed ? '[' + elapsed + ']' : '')}`
  )
  log()
  log(
    `${chalk.bold(url)} (${chalk.gray(currentReplicas)} ${chalk.gray(
      'current'
    )})`
  )
  log(printf('%6s %s', 'min', chalk.bold(min)))
  log(printf('%6s %s', 'max', chalk.bold(max)))
  log(printf('%6s %s', 'auto', chalk.bold(min === max ? '✖' : '✔')))
  log()
}
github curtgrimes / vmix-rest-api / app / splashScreen.js View on Github external
return;
  }

  if (!(await vmix.connected())) {
    console.log(wordwrap(0,70)(chalk.red.bold('Unable to connect to vMix at '+ configData.vmix_rest_api.vmix_path +'. Make sure vMix is running, Web Controller is on, and you\'ve set the correct Web Controller URL in the config file located at '+ config.getPath() +'.\n\nRestart the vMix REST API to try again.')));
    return;
  }
  
  if (configData.vmix_rest_api.remote_access.enabled) {
    remoteConnectionPath = await remoteAccess.connect();
  }
  
  console.log(center('Open '+ chalk.greenBright('http://localhost:' + configData.vmix_rest_api.port) + ' in a browser to begin.\n', 75));

  console.log(table([
    [chalk.bold('vMix REST API'), 'http://localhost:'+ configData.vmix_rest_api.port],
    ...(remoteConnectionPath ? [[chalk.bold('Remote Access'), remoteConnectionPath]] : []),
    ...(remoteConnectionPath && configData.vmix_rest_api.remote_access.remote_web_controller ? [[chalk.bold('Web Controller Remote Access'), remoteConnectionPath + '/web-controller']] : []),
    
    [chalk.bold('Local Web Controller'), configData.vmix_rest_api.vmix_path],
    [chalk.bold('Config'), config.getPath()],
  ], {
    columns: {
      0: {
        width: 25,
      },
      1: {
        width: 33,
      },
    }
  }));
};
github jfrux / workbench / app / main / services / zmq.js View on Github external
function writeLog(...params) {
  console.info(prefix('workbench') + ' ' + chalk.bold(bgTaskColor('[ZEROMQ]')), bgTaskColor(...params));
}
github lucasfcosta / learnyounode-pt-br / exercises / faa_isso_modular / verify.js View on Github external
if (typeof mod != 'function') {
    return modFileError(
        'does not export a ' + chalk.bold('single function') + '.'
      + 'You must use the `module.exports = function () {}` pattern.'
    )
  } else {
    exercise.emit('pass', 'Additional module file exports a single function')
  }

  //---- Check that the function exported takes 3 arguments

  if (mod.length < 3) {
    return modFileError(
        'exports a function that takes fewer than ' + chalk.bold('three') + ' arguments.'
      + 'You must accept a directory, a filter and a ' + chalk.bold('callback') + '.'
    )
  } else {
    exercise.emit('pass', 'Additional module file exports a function that takes ' + mod.length + ' arguments')
  }

  //---- Mock `fs.readdir` and check that an error bubbles back up through the cb 

  fs.$readdir = fs.readdir
  fs.readdir = function (dir, callback) {
    callback(error)
  }

  function noerr () {
    modFileError(
        'does not appear to pass back an error received from `fs.readdir()`'
      + 'Use the following idiomatic Node.js pattern inside your callback to `fs.readdir()`:'
github zeit / now / lib / check-update.js View on Github external
process.on('exit', () => {
    if (updateData) {
      const {current, latest, at} = updateData
      const ago = ms(Date.now() - at)
      console.log(`> ${chalk.white.bgRed('UPDATE NEEDED')} ` +
        `Current: ${current} – ` +
        `Latest ${chalk.bold(latest)} (released ${ago} ago)`)
      console.log('> Run `npm install -g now` to update')
    }
  })
github smollweide / lerna-terminal / src / renderHelpFocus / index.js View on Github external
function renderHelpFocus() {
	const out = [];
	out.join('');
	out.join(chalk.bold('Help'));
	out.join();
	out.join(`  ${chalk.bold('Usage')}`);
	out.join(`    lerna-terminal~$ [command]`);
	out.join();
	out.join(`  ${chalk.bold('Commands')}`);
	out.join(`    [string]          On Enter the given string will be executed in child process`);
	out.join(`    clear             Clear focused terminal panel`);
	out.join(`    start             Start (or restart) the npm script (see Usage) in focused terminal panel`);
	out.join(`    stop              Stops the npm script (see Usage) in focused terminal panel`);
	out.join(`    exit              Leave current child process and displays all terminal panels`);
	out.join();
	out.join();

	getUiState().print(out.join('\n'));
}