How to use the ansi-colors.grey 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 callumacrae / gulp-w3cjs / index.js View on Github external
// If this is false, stream was changed since validation
		if (erroredLine) {
			var errorColumn = message.lastColumn;

			// Trim before if the error is too late in the line
			if (errorColumn > 60) {
				erroredLine = erroredLine.slice(errorColumn - 50);
				errorColumn = 50;
			}

			// Trim after so the line is not too long
			erroredLine = erroredLine.slice(0, 60);

			// Highlight character with error
			erroredLine =
				colors.grey(erroredLine.substring(0, errorColumn - 1)) +
				colors.bold(colors.red(erroredLine[ errorColumn - 1 ])) +
				colors.grey(erroredLine.substring(errorColumn));
		}

		if (typeof(message.lastLine) !== 'undefined' || typeof(lastColumn) !== 'undefined') {
			fancyLog(type, file.relative, location, message.message);
		} else {
			fancyLog(type, file.relative, message.message);
		}

		if (erroredLine) {
			fancyLog(erroredLine);
		}
	});
github vialer / vialer-js / test / browser / shared / index.js View on Github external
async function step(actor, message, context = '') {
    let prefix

    prefix = actor.padEnd(7)
    if (context) context = c.italic(` <${context}>`)
    if (actor === 'alice') prefix = c.cyan(prefix)
    else if (actor === 'bob') prefix = c.magenta(prefix)
    else if (actor === 'charlie') prefix = c.yellow(prefix)
    console.log(`${prefix}${context} ${c.grey(message)}`)
    if (settings.DEBUG_MODE) {
        await utils.delay(2000)
    }
}
github microsoft / vscode / build / lib / stats.ts View on Github external
}, function () {
		if (log) {
			if (entry.totalCount === 1) {
				fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);

			} else {
				const count = entry.totalCount < 100
					? ansiColors.green(entry.totalCount.toString())
					: ansiColors.red(entry.totalCount.toString());

				fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
			}
		}

		this.emit('end');
	});
}
github microsoft / vscode / build / lib / stats.ts View on Github external
toString(pretty?: boolean): string {
		if (!pretty) {
			if (this.totalCount === 1) {
				return `${this.name}: ${this.totalSize} bytes`;
			} else {
				return `${this.name}: ${this.totalCount} files with ${this.totalSize} bytes`;
			}
		} else {
			if (this.totalCount === 1) {
				return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;

			} else {
				const count = this.totalCount < 100
					? ansiColors.green(this.totalCount.toString())
					: ansiColors.red(this.totalCount.toString());

				return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
			}
		}
	}
}
github mjeanroy / jasmine-utils / scripts / log / index.js View on Github external
function debug(msg) {
  log(colors.grey(msg));
}
github garage11 / ca11 / gulp / helpers.js View on Github external
let styledOptions = options.map((option) => {
                if (option === selected) return c.bold.green(option)
                else return c.grey(option)
            })
            return `${c.grey('[')}${styledOptions.join(c.grey('|'))}${c.grey(']')}`

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

74 / 100
Full package analysis