Functions

f
plain(text: string): string

The text with its colour taken off — what the terminal would show on a screen with none.

f
plainLength(text: string): number

Width as the terminal sees it — colour codes take columns nowhere but in the string.

f
terminalWidth(output: NodeJS.WritableStream): number

How wide a line may be. 80 where nothing says — a pipe has no width, and neither does a file.

f
truncate(
text: string,
width: number
): string

Cuts a line to width columns, counting what the terminal counts.

Variables

v
ESCAPE

The character every terminal control sequence begins with.