Home > @rushstack/terminal > AnsiEscape
AnsiEscape class
Operations for working with text strings that contain ANSI escape codes. The most commonly used escape codes set the foreground/background color for console output.
Signature:
export declare class AnsiEscape
Methods
Method | Modifiers | Description |
|---|---|---|
| Replaces ANSI escape codes with human-readable tokens. This is useful for unit tests that compare text strings in test assertions or snapshot files. | |
| ||
| Returns the input text with all ANSI escape codes removed. For example, this is useful when saving colorized console output to a log file. |