UNPKG

741 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.yellow = exports.clc = void 0;
4const isColorAllowed = () => !process.env.NO_COLOR;
5const colorIfAllowed = (colorFn) => (text) => isColorAllowed() ? colorFn(text) : text;
6exports.clc = {
7 bold: colorIfAllowed((text) => `\x1B[1m${text}\x1B[0m`),
8 green: colorIfAllowed((text) => `\x1B[32m${text}\x1B[39m`),
9 yellow: colorIfAllowed((text) => `\x1B[33m${text}\x1B[39m`),
10 red: colorIfAllowed((text) => `\x1B[31m${text}\x1B[39m`),
11 magentaBright: colorIfAllowed((text) => `\x1B[95m${text}\x1B[39m`),
12 cyanBright: colorIfAllowed((text) => `\x1B[96m${text}\x1B[39m`),
13};
14exports.yellow = colorIfAllowed((text) => `\x1B[38;5;3m${text}\x1B[39m`);