How to use the ansi-colors.symbols function in ansi-colors

To help you get started, we’ve selected a few ansi-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 webpack-contrib / webpack-log / src / index.js View on Github external
'use strict';

/* global window: true */
/* eslint-disable
  no-shadow,
  no-param-reassign,
  space-before-function-paren
*/
const uuid = require('uuid/v4');
const colors = require('ansi-colors');
const loglevel = require('loglevelnext');

const symbols = {
  trace: colors.grey('₸'),
  debug: colors.cyan('➤'),
  info: colors.blue(colors.symbols.info),
  warn: colors.yellow(colors.symbols.warning),
  error: colors.red(colors.symbols.cross),
};

const defaults = {
  name: '',
  level: 'info',
  unique: true,
  color: true,
};

const prefix = {
  level(options) {
    return symbols[options.level];
  },
  template: `{{level}} ${colors.gray('「{{name}}」')}: `,
github NewFuture / miniprogram-build / src / log / compile.js View on Github external
return through.obj((file, enc, cb) => {
        if (options.showFiles) {
            let output = chalk.whiteBright.bold(chalk.symbols.pointer) + ' ';
            const name = path.relative(file.base, file.path);
            if (options.minimal) {
                output += inputStyle(options.srcName || name);
            } else {
                output =
                    '\n' +
                    (file.cwd ? 'cwd:   ' + inputStyle(tildify(file.cwd)) : '') +
                    (file.base ? '\nbase:  ' + inputStyle(tildify(file.base)) : '') +
                    (file.path ? '\npath:  ' + inputStyle(tildify(file.path)) : '') +
                    // (file.stat && options.verbose ? '\nstat:  ' + prop(stringifyObject(file.stat, { indent: '       ' }).replace(/[{}]/g, '').trim()) : '') +
                    '\n';
            }

            // let outPath = ''
            if (options.distName) {
                output += outputStyle(options.distName);
github lint-deps / lint-deps / bin / cli.js View on Github external
.then(() => {
    console.log(colors.green(colors.symbols.check), 'done');
    process.exit();
  })
  .catch(err => {
github MurhafSousli / ngx-progressbar / .config / publish.js View on Github external
packages.map(function(package) {
  const packagePath = `${__dirname}/../dist/${package}`;
  execSync(`cd ${packagePath} && npm publish`);
  console.log(c.magenta(package), 'has been published', c.green(c.symbols.check));
});
github MurhafSousli / ngx-progressbar / .config / publish.js View on Github external
const c = require('ansi-colors');
const { execSync } = require('child_process');
const { readdirSync, statSync } = require('fs');
const { join } = require('path');

const getPackages = p =>
readdirSync(p).filter(f => statSync(join(p, f)).isDirectory());

const packages = getPackages('dist');

console.log(
  'Publishing packages',
  c.cyan(c.symbols.pointerSmall),
  c.yellow(packages)
);

packages.map(function(package) {
  const packagePath = `${__dirname}/../dist/${package}`;
  execSync(`cd ${packagePath} && npm publish`);
  console.log(c.magenta(package), 'has been published', c.green(c.symbols.check));
});
github NewFuture / miniprogram-build / src / lib / multi-replace.js View on Github external
function logReplace(n, key, value, file) {
    log.info(
        colors.gray(TITLE),
        colors.gray.bold(colors.symbols.check.repeat(n)),
        colors.gray.dim.italic.strikethrough(key.toString()),
        colors.dim.gray(colors.symbols.pointerSmall),
        typeof value === 'function' ? colors.cyan(colors.italic('Function:') + (value.name || '')) : colors.underline(value),
        colors.gray('(' + colors.underline(
            path.relative(file.base, file.path)
        ) + ')')
    )
}
github enquirer / enquirer / lib / symbols.js View on Github external
'use strict';

const isWindows = process.platform === 'win32';
const colors = require('ansi-colors');
const utils = require('./utils');

const symbols = {
  ...colors.symbols,
  upDownDoubleArrow: '⇕',
  upDownDoubleArrow2: '⬍',
  upDownArrow: '↕',
  asterisk: '*',
  asterism: '⁂',
  bulletWhite: '◦',
  electricArrow: '⌁',
  ellipsisLarge: '⋯',
  ellipsisSmall: '…',
  fullBlock: '█',
  identicalTo: '≡',
  indicator: colors.symbols.check,
  leftAngle: '‹',
  mark: '※',
  minus: '−',
  multiplication: '×',
github enquirer / enquirer / lib / style / symbols.js View on Github external
'use strict';

const colors = require('ansi-colors');
const isWindows = process.platform === 'win32';
const utils = require('../utils');

const checkboxSymbols = {
  indicator: colors.symbols.check,
  hexagon: {
    off: '⬡',
    on: '⬢'
  },
  ballot: {
    on: '☑',
    off: '☐',
    disabled: '☒'
  },
  stars: {
    on: '★',
    off: '☆',
    disabled: '☆'
  },
  folder: {
    on: '▼',
github NewFuture / miniprogram-build / src / log / size.js View on Github external
const finish = (err, size) => {
            if (err) {
                cb(new PluginError('size', err));
                return;
            }

            totalSize += size;

            if (opts.showFiles === true && size > 0) {
                log(
                    chalk.reset.whiteBright.dim(chalk.symbols.check),
                    chalk.green.underline.bold(opts.showTotal ? chalk.dim(file.relative) : file.relative),
                    size,
                    !opts.showTotal);
            }

            fileCount++;
            cb(null, file);
        };
github enquirer / enquirer / lib / symbols.js View on Github external
pilcrow2: '❡',
  pencilUpRight: '✐',
  pencilDownRight: '✎',
  pencilRight: '✏',
  plus: '+',
  plusMinus: '±',
  pointRight: '☞',
  rightAngle: '›',
  section: '§',
  hexagon: { off: '⬡', on: '⬢', disabled: '⬢' },
  ballot: { on: '☑', off: '☐', disabled: '☒' },
  stars: { on: '★', off: '☆', disabled: '☆' },
  folder: { on: '▼', off: '▶', disabled: '▶' },
  prefix: {
    pending: colors.symbols.question,
    submitted: colors.symbols.check,
    cancelled: colors.symbols.cross
  },
  separator: {
    pending: colors.symbols.pointerSmall,
    submitted: colors.symbols.middot,
    cancelled: colors.symbols.middot
  },
  radio: {
    off: isWindows ? '( )' : '◯',
    on: isWindows ? '(*)' : '◉',
    disabled: isWindows ? '(|)' : 'Ⓘ'
  },
  numbers: ['⓪', '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳', '㉑', '㉒', '㉓', '㉔', '㉕', '㉖', '㉗', '㉘', '㉙', '㉚', '㉛', '㉜', '㉝', '㉞', '㉟', '㊱', '㊲', '㊳', '㊴', '㊵', '㊶', '㊷', '㊸', '㊹', '㊺', '㊻', '㊼', '㊽', '㊾', '㊿']
};

symbols.merge = options => {

ansi-colors

Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).

MIT
Latest version published 2 years ago

Package Health Score

71 / 100
Full package analysis