πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

ansi-colors

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-colors - npm Package Compare versions

Comparing version

to
4.1.2

12

index.js
'use strict';
const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
const identity = val => val;

@@ -11,8 +10,9 @@ /* eslint-disable no-control-regex */

const create = () => {
const colors = { enabled: true, visible: true, styles: {}, keys: {} };
const colors = {
enabled: process.env.FORCE_COLOR !== '0',
visible: true,
styles: {},
keys: {}
};
if ('FORCE_COLOR' in process.env) {
colors.enabled = process.env.FORCE_COLOR !== '0';
}
const ansi = style => {

@@ -19,0 +19,0 @@ let open = style.open = `\u001b[${style.codes[0]}m`;

{
"name": "ansi-colors",
"description": "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).",
"version": "4.1.1",
"version": "4.1.2",
"homepage": "https://github.com/doowb/ansi-colors",

@@ -39,2 +39,3 @@ "author": "Brian Woodward (https://github.com/doowb)",

"keywords": [
"256",
"ansi",

@@ -60,6 +61,13 @@ "bgblack",

"bold",
"cli",
"clorox",
"color",
"colors",
"colour",
"command line",
"command-line",
"console",
"cyan",
"dim",
"formatting",
"gray",

@@ -72,8 +80,20 @@ "green",

"kleur",
"log",
"logging",
"magenta",
"red",
"reset",
"rgb",
"shell",
"str",
"strikethrough",
"string",
"style",
"styles",
"terminal",
"text",
"tty",
"underline",
"white",
"xterm",
"yellow"

@@ -80,0 +100,0 @@ ],

@@ -29,2 +29,3 @@ 'use strict';

plusMinus: 'Β±',
question: '?',
section: 'Β§',

@@ -42,3 +43,2 @@ starsOff: 'β˜†',

info: 'i',
question: '?',
questionSmall: '?',

@@ -59,3 +59,2 @@ pointer: '>',

info: 'β„Ή',
question: '?',
questionFull: '?',

@@ -62,0 +61,0 @@ questionSmall: 'οΉ–',

@@ -7,10 +7,77 @@ // Imported from DefinitelyTyped project.

interface SymbolsType {
check: string;
cross: string;
info: string;
line: string;
pointer: string;
pointerSmall: string;
question: string;
warning: string;
/**
* `undefined` on windows, `✘` on other platforms.
*/
ballotCross?: "✘";
ballotDisabled: "β˜’";
ballotOff: "☐";
ballotOn: "β˜‘";
bullet: "β€’";
bulletWhite: "β—¦";
/**
* `√` on windows, `βœ”` on other platforms.
*/
check: "√" | "βœ”";
/**
* `Γ—` on windows, `βœ–` on other platforms.
*/
cross: "Γ—" | "βœ–";
/**
* `...` on windows, `β‹―` on other platforms.
*/
ellipsisLarge: "..." | "β‹―";
/**
* `...` on windows, `…` on other platforms.
*/
ellipsis: "..." | "…";
fullBlock: "β–ˆ";
heart: "❀";
identicalTo: "≑";
info: "i" | "β„Ή";
line: "─";
mark: "β€»";
middot: "Β·";
minus: "-";
multiplication: "Γ—";
obelus: "Γ·";
pencilDownRight: "✎";
pencilRight: "✏";
pencilUpRight: "✐";
percent: "%";
pilcrow2: "❑";
pilcrow: "ΒΆ";
plusMinus: "Β±";
/**
* `>` on windows, `β–Έ` on linux, and `❯` on other platforms.
*/
pointer: ">" | "β–Έ" | "❯";
/**
* `Β»` on windows, `β€£` on linux, and `β€Ί` on other platforms.
*/
pointerSmall: "Β»" | "β€£" | "β€Ί";
question: "?";
/**
* `undefined` on windows, `?` on other platforms.
*/
questionFull?: "?";
/**
* `?` on windows, `οΉ–` on other platforms.
*/
questionSmall: "?" | "οΉ–";
/**
* `( )` on windows, `β—―` on other platforms.
*/
radioOff: "( )" | "β—―";
/**
* `(*)` on windows, `β—‰` on other platforms.
*/
radioOn: "(*)" | "β—‰";
section: "Β§";
starsOff: "β˜†";
starsOn: "β˜…";
upDownArrow: "↕";
/**
* `β€Ό` on windows, `⚠` on other platforms.
*/
warning: "β€Ό" | "⚠";
}

@@ -27,5 +94,2 @@

export interface StyleFunction extends StylesType<StyleFunction> {
(s: string): string;
}

@@ -86,79 +150,89 @@ interface StylesType<T> {

// modifiers
export const reset: StyleFunction;
export const bold: StyleFunction;
export const dim: StyleFunction;
export const italic: StyleFunction;
export const underline: StyleFunction;
export const inverse: StyleFunction;
export const hidden: StyleFunction;
export const strikethrough: StyleFunction;
declare namespace ansiColors {
interface StyleFunction extends StylesType<StyleFunction> {
(s: string): string;
}
// colors
export const black: StyleFunction;
export const red: StyleFunction;
export const green: StyleFunction;
export const yellow: StyleFunction;
export const blue: StyleFunction;
export const magenta: StyleFunction;
export const cyan: StyleFunction;
export const white: StyleFunction;
export const gray: StyleFunction;
export const grey: StyleFunction;
// modifiers
const reset: StyleFunction;
const bold: StyleFunction;
const dim: StyleFunction;
const italic: StyleFunction;
const underline: StyleFunction;
const inverse: StyleFunction;
const hidden: StyleFunction;
const strikethrough: StyleFunction;
// bright colors
export const blackBright: StyleFunction;
export const redBright: StyleFunction;
export const greenBright: StyleFunction;
export const yellowBright: StyleFunction;
export const blueBright: StyleFunction;
export const magentaBright: StyleFunction;
export const cyanBright: StyleFunction;
export const whiteBright: StyleFunction;
// colors
const black: StyleFunction;
const red: StyleFunction;
const green: StyleFunction;
const yellow: StyleFunction;
const blue: StyleFunction;
const magenta: StyleFunction;
const cyan: StyleFunction;
const white: StyleFunction;
const gray: StyleFunction;
const grey: StyleFunction;
// background colors
export const bgBlack: StyleFunction;
export const bgRed: StyleFunction;
export const bgGreen: StyleFunction;
export const bgYellow: StyleFunction;
export const bgBlue: StyleFunction;
export const bgMagenta: StyleFunction;
export const bgCyan: StyleFunction;
export const bgWhite: StyleFunction;
// bright colors
const blackBright: StyleFunction;
const redBright: StyleFunction;
const greenBright: StyleFunction;
const yellowBright: StyleFunction;
const blueBright: StyleFunction;
const magentaBright: StyleFunction;
const cyanBright: StyleFunction;
const whiteBright: StyleFunction;
// bright background colors
export const bgBlackBright: StyleFunction;
export const bgRedBright: StyleFunction;
export const bgGreenBright: StyleFunction;
export const bgYellowBright: StyleFunction;
export const bgBlueBright: StyleFunction;
export const bgMagentaBright: StyleFunction;
export const bgCyanBright: StyleFunction;
export const bgWhiteBright: StyleFunction;
// background colors
const bgBlack: StyleFunction;
const bgRed: StyleFunction;
const bgGreen: StyleFunction;
const bgYellow: StyleFunction;
const bgBlue: StyleFunction;
const bgMagenta: StyleFunction;
const bgCyan: StyleFunction;
const bgWhite: StyleFunction;
export let enabled: boolean;
export let visible: boolean;
export const ansiRegex: RegExp;
// bright background colors
const bgBlackBright: StyleFunction;
const bgRedBright: StyleFunction;
const bgGreenBright: StyleFunction;
const bgYellowBright: StyleFunction;
const bgBlueBright: StyleFunction;
const bgMagentaBright: StyleFunction;
const bgCyanBright: StyleFunction;
const bgWhiteBright: StyleFunction;
/**
* Remove styles from string
*/
export function stripColor(s: string): string;
let enabled: boolean;
let visible: boolean;
const ansiRegex: RegExp;
/**
* Remove styles from string
*/
export function strip(s: string): string;
/**
* Remove styles from string
*/
function stripColor(s: string): string;
/**
* Remove styles from string
*/
export function unstyle(s: string): string;
/**
* Remove styles from string
*/
function strip(s: string): string;
export const styles: StylesType<StyleType>;
export const symbols: SymbolsType;
/**
* Remove styles from string
*/
function unstyle(s: string): string;
/**
* Outputs a string with check-symbol as prefix
*/
export function ok(...args: string[]): string;
const styles: StylesType<StyleType>;
const symbols: SymbolsType;
/**
* Outputs a string with check-symbol as prefix
*/
function ok(...args: string[]): string;
function create(): typeof ansiColors;
}
export = ansiColors;