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(): string
text: string,
width: number
Cuts a line to width columns, counting what the terminal counts.
v
ESCAPE
The character every terminal control sequence begins with.
Usage
import * as mod from "lib/repl/terminal.ts";