Experimental

Highlight code at native speed

@pierre/chamele is a fast code highlighter written by hand in WebAssembly Text. It ships with built-in language lexers, works across runtimes, and speaks familiar Shiki-compatible formats. Made by The Pierre Computer Company.

DocumentationView on GitHub

63.3 kB gzipped Wasm · 56 built-in languages · 92–771× faster than Shiki (Benchmark)

Fast, familiar, and editor-ready.

Native WebAssembly performance, Shiki-compatible output, and incremental tokenization built for editors.

Native performance

One-pass lexers
Hand-written Wasm lexers emit HTML or token records directly, with no AST or grammar runtime.
Zero-copy output
codeToHtml() returns a view into WebAssembly memory, ready for a response, file, or decoder.
SIMD scans
Hot paths read 16 bytes per step, and equal styles share spans across whitespace.

Shiki compatibility

Familiar APIs
Use codeToHtml(), codeToTokens(), and codeToHast() in familiar highlighting workflows.
Tokens & HAST
Render Shiki-compatible themed tokens or HAST with decorations and transformers.
Themes included
Use bundled Zed themes or supply your own light and dark theme objects.

Editor friendly

Incremental edits
LiveTokenizer re-tokenizes only lines whose text or lexer state changed.
Visible-range rendering
Bound synchronous work to the viewport while off-screen lines converge in the background.
Precise updates
Every edit reports exactly which lines changed, leaving untouched rows alone.

With love from The Pierre Computer Company

Collectively, our team brings over 150 years of expertise designing, building, and scaling the world's largest distributed systems at Cloudflare, Coinbase, Discord, GitHub, Reddit, Stripe, X, and others.