How to use the colors/safe.grey 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 peteschaffner / framerjs-cli / bin / framer-new.js View on Github external
.arguments('[dir]')
  .option('-m, --module', 'create a module')
  .parse(process.argv);

var directory = path.resolve(program.args[0] || '.');
var projectType = require('../lib/framer_test.js')(directory);

// create [dir] if it doesn't exist
if (!projectType) fs.mkdirpSync(directory);

// scaffold project/module if [dir] is empty
if (!!!fs.readdirSync(directory).length) {
  var projectType = program.module ? 'module' : 'project';
  var toPath = '../boilerplate/' + projectType;

  console.log(colors.grey('Creating %s...'), projectType);
  fs.copySync(path.resolve(__dirname, toPath), directory);

  // move into [dir]
  process.chdir(directory);

  console.log(colors.grey('Installing project dependencies...'));
  exec('framer update');
  exec('npm install --production');
} else console.warn(colors.red('Error: ') + directory + ' is not empty');
github telefonicaid / logops / lib / formatters.js View on Github external
function formatDevTrace(level, context, message, args, err) {
  var str,
      mainMessage = util.format.apply(global, [message].concat(args)),
      printStack = API.stacktracesWith.indexOf(level) > -1,
      errCommomMessage = err && (err.name + ': ' + err.message),
      isErrorLoggingWithoutMessage = mainMessage === errCommomMessage;

  switch (level) {
    case 'DEBUG':
      str = colors.grey(level);
      break;
    case 'INFO':
      str = colors.blue(level) + ' '; // Pad to 5 chars
      break;
    case 'WARN':
      str = colors.yellow(level) + ' '; // Pad to 5 chars
      break;
    case 'ERROR':
      str = colors.red(level);
      break;
    case 'FATAL':
      str = colors.red.bold(level);
      break;
  }
  str += ' ' + mainMessage;
github Krinkle / mw-tool-tourbot / src / diff.js View on Github external
function formatDiff (diff, contextStart, linesBefore, linesAfter) {
  return colors.cyan('@@ line ' + contextStart + ' @@') + '\n' +
    // Prefix lines before with two spaces in order to align with "+ "
    (linesBefore ? colors.grey(linesBefore.replace(/^/gm, '  ')) + '\n' : '') +
    colors.red('- ' + diff.textBefore) + colors.bold.bgRed(diff.removed) + colors.red(diff.textAfter) + '\n' +
    (diff.added !== null
      ? (colors.green('+ ' + diff.textBefore) + colors.bold.bgGreen(diff.added) + colors.green(diff.textAfter) + '\n')
      : ''
    ) +
    colors.grey(linesAfter.replace(/^/gm, '  '));
}
github RossMcMillan92 / djent / tools / events.js View on Github external
const onFinish = (filename, outputPath, startTime) => {
    const endTime = Date.now();
    console.log(colors.green(`${colors.grey(filename)} finished: ${outputPath} in ${colors.blue(endTime - startTime + 'ms')}`));
}
github ridvankaradag / tracli-terminal / lib / commands.js View on Github external
.map(project => {
      console.log(
        `${Colors.yellow(project.id)} - ${Colors.bold(project.name)} | ${Colors.grey(new Date(
          project.created_at
        ).toString())}`
      );
    });
  }
github jaylinski / remok / src / utils / Print.js View on Github external
static debug(message) {
    Print.log(colors.grey(message), 4);
  }
github iensu / mocha-cakes-2 / lib / gwtabi-clause.js View on Github external
function gwtLabel(label, options) {
  if (!label) {
    return '';
  }

  if (!options.style){
    return label;
  }

  if (options.dark) {
    return colors.grey(label);
  }

  if (options.white) {
    return colors.white(label);
  }

  return colors.yellow(label);
}
github chialab / rna-cli / commands / __deprecated / icons / action.js View on Github external
} else {
                let icons = res.favicon.files_urls
                    .filter((url) => url.indexOf('manifest.json') === -1)
                    .map((url) => path.join(iconsPath, path.basename(url)));
                app.log(colors.bold(colors.green('icons generated!')));
                app.log(colors.grey(`(${icons.join(')\n(')})`));
                let newManifest = path.join(output, iconsPath, 'manifest.json');
                if (fs.existsSync(newManifest)) {
                    let realManifest = path.join(output, 'manifest.json');
                    fs.writeFileSync(realManifest, fs.readFileSync(newManifest));
                    fs.unlinkSync(newManifest);
                    app.log(`${colors.bold(colors.green('menifest generated!'))} ${colors.grey(`(${realManifest})`)}`);
                }
                if (res.favicon.html_code) {
                    app.log(colors.yellow('remember to include'));
                    app.log(colors.grey(
                        res.favicon.html_code.replace(path.join(iconsPath, 'manifest.json'), '/manifest.json')
                    ));
                    app.log(colors.yellow('in your index.html file.'));
                }
                resolve(res);
            }
        });
    });
github zombieleet / BlackOrphan / listener.js View on Github external
prompt() {
	process.stdout.write(color.bgBlack(color.grey(color.green(`${this.id}_${this.address}:${this.port}`) + ' > ')));
    },
    setPrompt(sockParams) {