Class Ansi
Source: ansi.ts
Provides utility functions for wrapping text in ANSI escape codes.
See
Methods
black()
staticblack(text:string):string
Makes text black using ANSI.fg.black.
Parameters
text
string
Returns
string
red()
staticred(text:string):string
Makes text red using ANSI.fg.red.
Parameters
text
string
Returns
string
green()
staticgreen(text:string):string
Makes text green using ANSI.fg.green.
Parameters
text
string
Returns
string
yellow()
staticyellow(text:string):string
Makes text yellow using ANSI.fg.yellow.
Parameters
text
string
Returns
string
blue()
staticblue(text:string):string
Makes text blue using ANSI.fg.blue.
Parameters
text
string
Returns
string
magenta()
staticmagenta(text:string):string
Makes text magenta using ANSI.fg.magenta.
Parameters
text
string
Returns
string
cyan()
staticcyan(text:string):string
Makes text cyan using ANSI.fg.cyan.
Parameters
text
string
Returns
string
white()
staticwhite(text:string):string
Makes text white using ANSI.fg.white.
Parameters
text
string
Returns
string
blackBackground()
staticblackBackground(text:string):string
Sets background to black using ANSI.bg.black.
Parameters
text
string
Returns
string
redBackground()
staticredBackground(text:string):string
Sets background to red using ANSI.bg.red.
Parameters
text
string
Returns
string
greenBackground()
staticgreenBackground(text:string):string
Sets background to green using ANSI.bg.green.
Parameters
text
string
Returns
string
yellowBackground()
staticyellowBackground(text:string):string
Sets background to yellow using ANSI.bg.yellow.
Parameters
text
string
Returns
string
blueBackground()
staticblueBackground(text:string):string
Sets background to blue using ANSI.bg.blue.
Parameters
text
string
Returns
string
magentaBackground()
staticmagentaBackground(text:string):string
Sets background to magenta using ANSI.bg.magenta.
Parameters
text
string
Returns
string
cyanBackground()
staticcyanBackground(text:string):string
Sets background to cyan using ANSI.bg.cyan.
Parameters
text
string
Returns
string
whiteBackground()
staticwhiteBackground(text:string):string
Sets background to white using ANSI.bg.white.
Parameters
text
string
Returns
string
bold()
staticbold(text:string):string
Makes text bold using ANSI.decoration.bold.
Parameters
text
string
Returns
string
dim()
staticdim(text:string):string
Makes text dim using ANSI.decoration.dim.
Parameters
text
string
Returns
string
italic()
staticitalic(text:string):string
Makes text italic using ANSI.decoration.italic.
Parameters
text
string
Returns
string
underline()
staticunderline(text:string):string
Underlines text using ANSI.decoration.underline.
Parameters
text
string
Returns
string
invert()
staticinvert(text:string):string
Inverts foreground and background colors using ANSI.decoration.invert.
Parameters
text
string
Returns
string
strike()
staticstrike(text:string):string
Makes text strike through using ANSI.decoration.strike.
Parameters
text
string
Returns
string
strip()
staticstrip(text:string):string
Removes all ANSI escape sequences.
Parameters
text
string
Returns
string
stripColors()
staticstripColors(text:string):string
Removes ANSI escape sequences for colors and background colors (SGR).
Parameters
text
string
Returns
string