Installation

The library ships as ESM with TypeScript declarations.

Shell
npm install @opentf/syntax-highlighter

Requirements

  • 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.

Last updated on
Edit this page