terminal-png
v0.1.8
Published
Render PNG images from ANSI terminal output.
Downloads
417
Readme
terminal-png
Render PNG images from ANSI terminal output.
API
import { renderTerminalPng } from "terminal-png";
await renderTerminalPng(ansiText, {
output: "example.png",
window: true,
padding: 20
});Configuration Options
output: path to the output PNG filewindow: include terminal window chromepadding: non-negative integer padding around the rendered terminal content
The ANSI parser supports common SGR styling, cursor positioning and movement, save/restore cursor, erase-in-line/display, tabs, double-width characters, and combining marks. Parsed terminal state is bounded to 1000 rows by 1000 columns to avoid unbounded renders from hostile control sequences.
CLI
terminal-png <input.ansi> -o <output.png> [--window] [--padding 20]Environment Variables
This package does not read public environment variables. The comparison script inherits PATH only to locate the local CLI under test.
