Signature

Import

Constructors

Properties

PropertyModifiersTypeDescription
asChromeConsoleLogArgumentsany[]
any[]
namesstatic(string | number)[]
statictypeof Colorsinstalls String prototype extensions
parsedColors & {
spans: any[];
}
static{
black: number[];
darkGray: number[];
lightGray: number[];
white: number[];

lightRed: number[];
green: number[];
lightGreen: number[];
yellow: number[];
lightYellow: number[];
blue: number[];
lightBlue: number[];
magenta: number[];
lightMagenta: number[];
cyan: number[];
lightCyan: number[];
}
spansany[]
any

Methods

Constructs a new instance of the class

Signature

  1. constructor(s?: string);

Parameters

ParameterTypeDescription
sstringa string containing ANSI escape codes.

asChromeConsoleLogArguments property

Signature

  1. get asChromeConsoleLogArguments(): any[];

browserConsoleArguments property

Signature

names property

    installs String prototype extensions

    Signature

    1. static get nice(): typeof Colors;

    require (‘ansicolor’).nice console.log (‘foo’.bright.red)

    parsed property

    Signature

    1. get parsed(): Colors & {
    2. spans: any[];
    3. };

    rgb property

    Signature

    spans property

    Signature

    1. spans: any[];

    Signature

    1. get str(): any;

    [Symbol.iterator] method

    Signature

    1. [Symbol.iterator](): IterableIterator<any>;

    Returns:

    IterableIterator<any>

    parse method

    parses a string containing ANSI escape codes

    Signature

    Parameters

    Returns:

    Colors & { spans: any[]; }

    {Colors} parsed representation.

    strip method

    strips ANSI codes from a string

    Signature

    1. static strip(s: string): string;

    Parameters

    ParameterTypeDescription
    sstringa string containing ANSI escape codes.

    Returns:

    {string} clean string.