Overview
Shiki is a syntax highlighter built on TextMate grammars, the same engine that powers VS Code. It provides accurate and beautiful code highlighting with zero runtime overhead—all highlighting is performed at build time, allowing you to ship zero JavaScript while maintaining perfect syntax highlighting.
The tool is highly customizable with a HAST-based architecture that supports addons and transformations. Shiki is fully tree-shakable ESM and runs universally across any JavaScript runtime, including browsers, Node.js, Cloudflare Workers, and more.
Key features
- TextMate grammar support
- Zero runtime JavaScript
- Build-time highlighting
- HAST-based architecture
- Customizable transformations
- ESM and tree-shakable
- Universal JavaScript runtime support
- Dual theme support
- Accurate syntax highlighting matching VS Code
- No runtime performance overhead
- Highly customizable with addons and transformations
- Works across all JavaScript environments
- Lightweight and tree-shakable
- Requires build-time processing
- Learning curve for custom themes and languages
Best for
Alternatives
More Library
Compare allData-fetching and state management library designed to handle server state in web applications.
Zero-dependency module loading environment variables from .env files into Node.js apps.
JavaScript library designed for building user interfaces with a focus on declarative syntax and efficiency.