What is this?
Shiki is a syntax highlighter for code snippets, built on TextMate grammar so the tokenization is accurate and the output is visually clean.
Is this a library I add to my project, or a standalone app?
It is a JavaScript/TypeScript library (published as the 'shiki' package) that you import to highlight code programmatically, not a standalone application.
How do I start using it to highlight code?
This README excerpt does not show install commands, but as the 'shiki' npm package you would add it with your package manager and call its highlighter API from JS/TS to render highlighted code.
Why are there separate v0-v4 branches?
Shiki keeps older major releases (v0 legacy, v1, v2, v3) on their own branches while active development happens on the v4.x main branch, so users on an older API can still find the matching docs and fixes.
What does 'based on TextMate grammar' actually mean?
Shiki tokenizes source code using the same TextMate grammars that power VS Code's highlighting, so the colors and token boundaries closely match what you'd see in that editor rather than a simpler regex-based highlighter.
Is Shiki free to use commercially?
Yes, it's MIT-licensed, so it can be used in commercial and open-source projects with minimal restrictions.
What are similar projects?
prism, MDsveX, woocommerce, microlighter, lollipop-css, editor.md, tui.editor, pug
Which topics is it in?
syntax-highlighting, npm-package, monorepo, ci, javascript-library, testing, browser, documentation, markdown, frontend, tool, nodejs