Files
effect/packages/printer-ansi/README.md
T
2026-07-30 02:59:57 +00:00

1.3 KiB

ANSI Terminal Pretty Printer for Effect-TS

Installation

@effect/printer-ansi

npm install @effect/printer-ansi
pnpm install @effect/printer-ansi
yarn add @effect/printer-ansi

Overview

This package defines a renderer for documents generated by the @effect/printer package, suitable for displaying them on ANSI-compatible terminals, including colors, bolding, underlining and italicizing.

For more information about @effect/printer in general, refer to the main @effect/printer package documentation.

Terminal Output and Untrusted Text

Text leaves are rendered verbatim, including control characters. Rendering returns a string and does not make untrusted text safe for a terminal. Apply AnsiDoc.sanitize to attacker-controlled subtrees before writing the result to a terminal. Keep trusted, intentional terminal sequences outside the sanitized subtree.

Acknowledgements

This package is a port of https://github.com/quchen/prettyprinter