Installation
The library ships as ESM with TypeScript declarations.
Shell
npm install @opentf/syntax-highlighterShell
pnpm add @opentf/syntax-highlighterShell
yarn add @opentf/syntax-highlighterShell
bun add @opentf/syntax-highlighterShell
deno add npm:@opentf/syntax-highlighterRequirements
A modern JavaScript runtime: Browser, Node.js, Deno, Bun, Next.js, Edge, or any SSR environment.
No native dependencies and no build step — the package runs wherever ESM runs.
What's included
The core tokenizer plus 102 language definitions, loaded lazily per language.
Four renderers: browser CSS Highlights, HTML/SSR, JSON, and ANSI.
15 CSS themes for browser and HTML output, and 16 ANSI themes for terminals.