npm.io
0.51.0 • Published 1 week ago

@effect/printer-ansi

Licence
MIT
Version
0.51.0
Deps
1
Size
265 kB
Vulns
0
Weekly
0
Stars
15.2K

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