How to use the kleur.magenta function in kleur

To help you get started, we’ve selected a few kleur 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 moleculerjs / moleculer / src / middlewares / hot-reload.js View on Github external
watchItem.watcher = fs.watch(fName, (eventType) => {
				const relPath = path.relative(process.cwd(), fName);
				broker.logger.info(kleur.magenta().bold(`The '${relPath}' file is changed. (Event: ${eventType})`));

				// Clear from require cache
				clearRequireCache(fName);
				if (watchItem.others.length > 0) {
					watchItem.others.forEach(f => clearRequireCache(f));
				}

				if (watchItem.brokerRestart && broker.runner && _.isFunction(broker.runner.restartBroker)) {
					broker.logger.info(kleur.bgMagenta().white().bold("Action: Restart broker..."));
					stopAllFileWatcher(projectFiles);
					// Clear the whole require cache
					require.cache.length = 0;
					return broker.runner.restartBroker();

				} else if (watchItem.allServices) {
					// Reload all services
github kyonenjs / udeguchi / src / download_assets.js View on Github external
const [asset_name, asset_url] = is_ebook
		? [
			safe_name(`${lecture_index} ${asset['title']}.pdf`),
			asset['asset']['url_set']['E-Book'][0]['file']
		]
		: [
			safe_name(`${lecture_index} ${asset['filename']}`),
			asset['url_set']['File'][0]['file']
		];
	const asset_name_with_path = path.join(chapter_path, asset_name);
	const asset_id = asset['id'];
	const asset_size = asset['file_size'];

	if (fs.existsSync(asset_name_with_path)) {
		is_ebook
		? console.log(`\n  ${magenta().inverse(' Lecture ')}  ${asset_name}  ${yellow('(already downloaded)')}`)
		: console.log(`\n    ${gray(inverse(' Asset '))}  ${asset_name}  ${yellow('(already downloaded)')}`);
	} else {
		await save_asset({
			is_ebook,
			asset_url,
			asset_name,
			asset_id,
			asset_size,
			chapter_path,
			lecture_index
		}).catch(error => {
			is_ebook
			? process.stderr.write(`\n  ${magenta().inverse(' Lecture ')}  ${asset_name}`)
			: process.stderr.write(`\n    ${gray(inverse(' Asset '))}  ${asset_name}`);

			throw error;
github moleculerjs / moleculer / src / metrics / reporters / console.js View on Github external
labelsToStr(labels) {
		const keys = Object.keys(labels);
		if (keys.length == 0)
			return kleur.gray("{}");

		return kleur.gray("{") + keys.map(key => `${kleur.gray(this.formatLabelName(key))}: ${kleur.magenta(labels[key])}`).join(", ") + kleur.gray("}");
	}
github lukeed / sirv / packages / sirv-cli / boot.js View on Github external
function toTime() {
	return '[' + colors.magenta(stamp()) + '] ';
}
github BubuAnabelas / markcat / src / options.js View on Github external
import kleur from 'kleur'
import { list, identity } from './util'

const defaultOptions = {
	code: kleur.yellow,
	blockquote: kleur.gray().bgWhite().italic,
	html: kleur.gray,
	heading: kleur.green().bold,
	firstHeading: kleur.magenta().underline().bold,
	hr: kleur.reset,
	listitem: kleur.reset,
	list: list,
	table: kleur.reset,
	paragraph: identity,
	strong: kleur.bold,
	em: kleur.italic,
	codespan: kleur.yellow,
	del: kleur.dim().gray().strikethrough,
	link: kleur.blue,
	href: kleur.blue().underline,
	text: identity,
	unescape: true,
	emoji: true,
	width: 80,
	showSectionPrefix: true,
github moleculerjs / moleculer-web / src / alias.js View on Github external
toString() {
		return kleur.magenta(_.padStart(this.method, 6)) + " " + kleur.cyan(this.fullPath) + kleur.grey(" => ") + (this.handler != null && this.type !== "multipart" ? "" : this.action);
	}
github ziishaned / dumper.js / src / dumper.js View on Github external
prepareValueDump(indent, originalValue) {
    let displayType = '';
    let displayValue = '';

    const paramType = kindOf(originalValue);
    switch (paramType) {
      case 'array':
      case 'object':
        displayType = '';
        displayValue = this.generateDump(originalValue, `${indent}${this.spaces}`);
        break;
      case 'boolean':
        displayType = 'boolean';
        displayValue = magenta(`${originalValue}`);
        break;
      case 'string':
        displayType = 'string';
        displayValue = `${red(`"${originalValue}"`)} (length=${originalValue.length})`;
        break;
      case 'null':
        displayValue = blue('null');
        break;
      case 'undefined':
        displayValue = blue('undefined');
        break;
      case 'number':
        displayType = Number.isInteger(originalValue) ? 'int' : 'float';
        displayValue = green(originalValue);
        break;
      case 'function':
github preactjs / preact-cli / packages / cli / lib / lib / webpack / run-webpack.js View on Github external
const addCompilerPrefix = msg =>
		name ? bold(magenta(name + ': ')) + msg : msg;
	if (field === 'errors' && stats.hasErrors()) {
github moleculerjs / moleculer / dev / action-hooks.js View on Github external
hello(ctx, res) {
				broker.logger.info(kleur.magenta("  After hook"));
				return res;
			}
		},
github moleculerjs / moleculer / dev / event-ctx.js View on Github external
"user.created"(ctx) {
			this.logger.info(kleur.magenta(`${this.broker.nodeID}:${this.fullName}:mixin: Event '${ctx.eventName}' received. Payload:`), ctx.params, ctx.meta);
		}
	}