Skip to content
Effect Days 2026 Get your ticket

Ansi

67 exports Added in v1.0.0 Source

Colors

bgBlack

Added in v1.0.0 Source

Signature

declare const bgBlack: Ansi

Signature

declare const bgBlackBright: Ansi

bgBlue

Added in v1.0.0 Source

Signature

declare const bgBlue: Ansi

bgBlueBright

Added in v1.0.0 Source

Signature

declare const bgBlueBright: Ansi

bgCyan

Added in v1.0.0 Source

Signature

declare const bgCyan: Ansi

bgCyanBright

Added in v1.0.0 Source

Signature

declare const bgCyanBright: Ansi

bgGreen

Added in v1.0.0 Source

Signature

declare const bgGreen: Ansi

Signature

declare const bgGreenBright: Ansi

bgMagenta

Added in v1.0.0 Source

Signature

declare const bgMagenta: Ansi

Signature

declare const bgMagentaBright: Ansi

bgRed

Added in v1.0.0 Source

Signature

declare const bgRed: Ansi

bgRedBright

Added in v1.0.0 Source

Signature

declare const bgRedBright: Ansi

bgWhite

Added in v1.0.0 Source

Signature

declare const bgWhite: Ansi

Signature

declare const bgWhiteBright: Ansi

bgYellow

Added in v1.0.0 Source

Signature

declare const bgYellow: Ansi

Signature

declare const bgYellowBright: Ansi

black

Added in v1.0.0 Source

Signature

declare const black: Ansi

blackBright

Added in v1.0.0 Source

Signature

declare const blackBright: Ansi

blue

Added in v1.0.0 Source

Signature

declare const blue: Ansi

blueBright

Added in v1.0.0 Source

Signature

declare const blueBright: Ansi

cyan

Added in v1.0.0 Source

Signature

declare const cyan: Ansi

cyanBright

Added in v1.0.0 Source

Signature

declare const cyanBright: Ansi

green

Added in v1.0.0 Source

Signature

declare const green: Ansi

greenBright

Added in v1.0.0 Source

Signature

declare const greenBright: Ansi

magenta

Added in v1.0.0 Source

Signature

declare const magenta: Ansi

Signature

declare const magentaBright: Ansi

red

Added in v1.0.0 Source

Signature

declare const red: Ansi

redBright

Added in v1.0.0 Source

Signature

declare const redBright: Ansi

white

Added in v1.0.0 Source

Signature

declare const white: Ansi

whiteBright

Added in v1.0.0 Source

Signature

declare const whiteBright: Ansi

yellow

Added in v1.0.0 Source

Signature

declare const yellow: Ansi

yellowBright

Added in v1.0.0 Source

Signature

declare const yellowBright: Ansi

Commands

beep

Added in v1.0.0 Source

Play a beeping sound.

Signature

declare const beep: Ansi

Moves the cursor backward by the specified number of columns (default 1) relative to the current cursor position.

If the cursor is already at the edge of the screen, this has no effect.

Signature

declare const cursorBackward: (columns?: number) => Ansi

cursorDown

Added in v1.0.0 Source

Moves the cursor down by the specified number of lines (default 1) relative to the current cursor position.

If the cursor is already at the edge of the screen, this has no effect.

Signature

declare const cursorDown: (lines?: number) => Ansi

Moves the cursor forward by the specified number of columns (default 1) relative to the current cursor position.

If the cursor is already at the edge of the screen, this has no effect.

Signature

declare const cursorForward: (columns?: number) => Ansi

cursorHide

Added in v1.0.0 Source

Hides the cursor.

Signature

declare const cursorHide: Ansi

cursorLeft

Added in v1.0.0 Source

Moves the cursor to the first column of the current row.

Signature

declare const cursorLeft: Ansi

cursorMove

Added in v1.0.0 Source

Move the cursor position the specified number of rows and columns relative to the current cursor position.

If the cursor is already at the edge of the screen in either direction, then additional movement will have no effect.

Signature

declare const cursorMove: (column: number, row?: number) => Ansi

Moves cursor to beginning of the line the specified number of rows down (default 1).

Signature

declare const cursorNextLine: (rows?: number) => Ansi

Moves cursor to beginning of the line the specified number of rows up (default 1).

Signature

declare const cursorPrevLine: (rows?: number) => Ansi

Restores the cursor position, encoding shift state and formatting attributes from the previous save, if any, otherwise resets these all to their defaults.

Signature

declare const cursorRestorePosition: Ansi

Saves the cursor position, encoding shift state and formatting attributes.

Signature

declare const cursorSavePosition: Ansi

cursorShow

Added in v1.0.0 Source

Shows the cursor.

Signature

declare const cursorShow: Ansi

cursorTo

Added in v1.0.0 Source

Moves the cursor to the specified row and column.

Though the ANSI Control Sequence for Cursor Position is 1-based, this method takes row and column values starting from 0 and adjusts them to 1- based values.

Signature

declare const cursorTo: (column: number, row?: number) => Ansi

cursorUp

Added in v1.0.0 Source

Moves the cursor up by the specified number of lines (default 1) relative to the current cursor position.

If the cursor is already at the edge of the screen, this has no effect.

Signature

declare const cursorUp: (lines?: number) => Ansi

eraseDown

Added in v1.0.0 Source

Clears from the current cursor position to the end of the screen.

The current cursor position does not change.

Signature

declare const eraseDown: Ansi

eraseEndLine

Added in v1.0.0 Source

Clears from the current cursor position to the end of the current line.

The current cursor position does not change.

Signature

declare const eraseEndLine: Ansi

eraseLine

Added in v1.0.0 Source

Clears the current line.

The current cursor position does not change.

Signature

declare const eraseLine: Ansi

eraseLines

Added in v1.0.0 Source

Erase from the current cursor position up the specified amount of rows.

Signature

declare const eraseLines: (rows: number) => Ansi

eraseScreen

Added in v1.0.0 Source

Clears the entire screen and move the cursor to the upper left.

Signature

declare const eraseScreen: Ansi

Clears from the current cursor position to the start of the current line.

The current cursor position does not change.

Signature

declare const eraseStartLine: Ansi

eraseUp

Added in v1.0.0 Source

Clears from the current cursor position to the beginning of the screen.

The current cursor position does not change.

Signature

declare const eraseUp: Ansi

Constructors

bgColor

Added in v1.0.0 Source

Signature

declare const bgColor: (color: Color) => Ansi

Signature

declare const bgColorBright: (color: Color) => Ansi

bold

Added in v1.0.0 Source

Signature

declare const bold: Ansi

brightColor

Added in v1.0.0 Source

Signature

declare const brightColor: (color: Color) => Ansi

color

Added in v1.0.0 Source

Signature

declare const color: (color: Color) => Ansi

italicized

Added in v1.0.0 Source

Signature

declare const italicized: Ansi

Signature

declare const strikethrough: Ansi

underlined

Added in v1.0.0 Source

Signature

declare const underlined: Ansi

Destructors

stringify

Added in v1.0.0 Source

Signature

declare const stringify: (self: Ansi) => string

Model

Ansi interface

Added in v1.0.0 Source

Signature

interface Ansi extends Proto {}

Other

Ansi

Added in v1.0.0 Source

combine

Added in v1.0.0 Source

Signature

declare const combine: {
(that: Ansi): (self: Ansi) => Ansi;
(self: Ansi, that: Ansi): Ansi;
}

Symbol

AnsiTypeId

Added in v1.0.0 Source

Signature

declare const AnsiTypeId: unique symbol

AnsiTypeId type

Added in v1.0.0 Source

Signature

type AnsiTypeId = typeof AnsiTypeId