starry-night
Reasonable, with limits. 6th of 8 code editors and highlighters.
starry-night is a TextMate-grammar highlighter that reproduces GitHub's code colouring and returns a hast tree with GitHub-style CSS classes. It does a narrow job well, mostly at build time in unified/rehype pipelines, but for most new projects Shiki does the same kind of highlighting with more themes, more features and far more users. It is a highlighter only and cannot edit code.
Best for: Static sites and Markdown pipelines (unified/rehype) that want code to look exactly like it does on GitHub, highlighted at build time.
Scores
Overall6.1
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 5.0, likely 4.0 to 6.0
It is a good, carefully maintained highlighter for anyone who wants GitHub-identical output in a rehype pipeline. Shiki uses the same TextMate approach with more themes, features and adoption. Lighter peers such as Prism and highlight.js suit browser use better, and it cannot edit code at all. That makes it a reasonable niche pick rather than a default.
- peers Shiki dependentRepos: Shiki has 26,594 dependent repos against 56
- tanstack.com/highlight/latest/docs/comparison: Positioned for GitHub-like scopes, with a heavy footprint
- github.com/denoland/deno-gfm/pull/67: Too slow for on-the-fly highlighting
GPT-6.2 Sol: 7.1, likely 5.9 to 8.2
Pick starry-night when PrettyLights-style classes, uncommon grammars, or a transformable output tree matter. Shiki is a stronger default for themed documentation with ready-made transformers, and highlight.js is simpler for browser highlighting that needs automatic language detection. Regular grammar updates support a new adoption, while limited adoption and a release history concentrated in one account keep the range wide.
- sveltex.dev/docs/code: Downstream comparison recommends Shiki and identifies starry-night’s grammar coverage.
- highlightjs.org: Documents browser support, automatic detection, and zero dependencies.
- github.com/wooorm/starry-night/releases: Recent releases maintain the grammar collection in the stable v3 line.
- dependents, peers: Tracked adoption trails the major general-purpose highlighters.
Needed by many4.1
How many developers need a tool for this job?
Claude Opus 5.5: 4.0, likely 3.0 to 5.0
The category covers editing and highlighting. starry-night only highlights, and it is aimed at build-time or server-side use, because its WASM engine and large grammars are heavy in browsers. That leaves a clear niche: docs sites, blogs and Markdown tools that want GitHub-style output.
- github.com/wooorm/starry-night: README suggests lowlight or refractor for browsers because of WASM and grammar size
- mdxjs.com/guides/syntax-highlighting: Listed as a compile-time highlighter for MDX
GPT-6.2 Sol: 4.1, likely 3.0 to 5.3
Read-only code highlighting serves documentation, tutorials, and source previews. The library works in browsers and at build time, while its emphasis on GitHub-style markup narrows the audience and editing requires a separate component. The available survey data gives little precision on how many projects need embedded highlighting.
- github.com/wooorm/starry-night: Documents browser and build-time rendering and the scope of the API.
- 2025.stateofjs.com/en-US/other-tools: Surveys developers’ own text editors and provides no direct measure of embedded highlighter demand.
Helps a lot6.9
How well does it do the job for those who need it?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Its highlighting is accurate, it covers 600+ grammars, and it outputs a clean hast tree with types and thorough docs. It is slow and large, and the WASM binary must be wired up by hand. Shiki is built on the same engine and adds many themes, transformers and better tooling, so for most users Shiki does this job better.
- github.com/wooorm/starry-night: 600+ grammars, hast output, sizes of 185 kB core and 1.6 MB for all grammars, WASM pinning caveat
- github.com/denoland/deno-gfm/pull/67: Deno trial found it about 10x slower than Prism and dropped it
- tanstack.com/highlight/latest/docs/comparison: Independent comparison names its large grammar and WASM footprint as the main tradeoff
GPT-6.2 Sol: 7.8, likely 6.7 to 8.8
Version 3.11.0 pairs broad TextMate coverage with a typed output tree and clear setup examples for developers and coding agents. WebAssembly and grammar registration add setup, and an open user report shows a JavaScript highlighting error. On one large JavaScript input it was slower than Prism and highlight.js and faster than Shiki, with different output formats limiting how far the timings generalize.
- github.com/wooorm/starry-night: Documents grammar coverage, typed output, and setup examples.
- github.com/wooorm/starry-night/issues/54: Open report of incorrect highlighting around a JavaScript regular expression.
- pierre.computer/writing/on-highlighting-code: October benchmark compares warmed highlighting on one large JavaScript input.
- qip.dev/syntax-highlight-comparison: Node benchmark of 3.11.0 places it behind Prism and Sugar High and ahead of Shiki.
Holds up over time6.2
Will it still be a good choice in two years?
Claude Opus 5.5: 6.0, likely 4.0 to 7.0
The project is mature and stable. It had 18 commits and 3 releases in the last year, mostly grammar syncs, and only 3 open issues. One well-known maintainer of the unified ecosystem carries it, and only 5 people have contributed. The pace is slow but steady.
- github commitsLastYear: 18 commits and 3 releases in the last year
- github contributors: Only 5 contributors
- github openIssues: 3 open issues against 35 closed
GPT-6.2 Sol: 6.4, likely 5.1 to 7.7
Three releases and 18 commits in the last year point to steady, light maintenance, with recent releases refreshing grammars within the same major version. One account published all three GitHub releases, and the package lists a personal sponsorship link with funding levels unclear. A highlighting report has stayed open for over a year, which adds uncertainty about how quickly future defects will be fixed.
- github commitsLastYear, releasesLastYear, openIssues, openPullRequests: 18 commits, three releases, three open issues, and one open pull request.
- github.com/wooorm/starry-night/releases: The same account published the latest three releases, mostly with Linguist refreshes.
- github.com/wooorm/starry-night/blob/3.11.0/package.json: Package metadata lists a personal GitHub Sponsors link.
- github.com/wooorm/starry-night/issues: JavaScript and AWK reports from 2025 remain open.
Used widely3.1
How many use it, and is that growing?
Claude Opus 5.5: 3.0, likely 2.0 to 4.0
Downloads rose from 110k to 644k per 4 weeks, a ratio of 5.9 against the 4.1 median. Only 56 repositories and 19 packages depend on it, so most installs likely come through other tools rather than direct choices. Peers such as Shiki, Prism and highlight.js have tens of thousands to hundreds of thousands of dependents.
- npm downloadsLast4Weeks: 643,875 now against 109,742 a year ago
- dependents: 56 repos and 19 packages, against 26,594 repos for Shiki
- bluesky posts: Only 3 posts, one from the maintainer
GPT-6.2 Sol: 3.1, likely 1.9 to 4.4
Four-week npm downloads rose 5.87× to about 644,000, above the catalog median of 4.1× and below Shiki’s 9.70×. The 56 tracked repositories are slightly ahead of Sugar High and far behind Shiki, Prism, and highlight.js. Repeated installs, indirect installs through plugins, and partial repository coverage make the number of projects choosing it difficult to pin down. Three Bluesky posts show limited attention, and the top Hacker News matches concern the painting.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, medianDownloadsRatio: 643,875 versus 109,742 installs, with growth above the catalog median.
- dependents, peers, github stars: 56 tracked repositories, 19 tracked packages, and 1,818 stars.
- bluesky posts, hackerNews top: Three linked posts on Bluesky and irrelevant top Hacker News matches.
- methanol.sudomaker.com/reference/code-highlighting: Shows how framework users can install the library indirectly through rehype.
Vouched for4.6
Who stands behind it being good?
Claude Opus 5.5: 3.0, likely 2.0 to 4.0
The MDX docs list it as a highlighting option, and there is an official rehype plugin plus a community one. I found no well-known production users, survey data or favourable independent benchmarks. The one independent trial I found, by Deno, rejected it as too slow.
- mdxjs.com/guides/syntax-highlighting: Listed among compile-time highlighters in the MDX docs
- npmjs.com/package/@microflash/rehype-starry-night: Third-party rehype plugin built on it
- github.com/denoland/deno-gfm/pull/67: Deno evaluated it and dropped it
GPT-6.2 Sol: 6.1, likely 4.8 to 7.4
MUI depends on it in its documentation tooling, Methanol enables it by default, and SvelTeX supports it as a backend. Independent benchmarks and user reports describe real performance and integration trade-offs. The range stays wide because the evidence comes mainly from documentation tools and focused tests, with little survey evidence on satisfaction or retention.
- github.com/mui/mui-public/blob/master/packages/docs-infra/package.json: MUI’s documentation infrastructure depends on starry-night 3.11.0.
- methanol.sudomaker.com/reference/code-highlighting: Methanol ships it as the default highlighter.
- sveltex.dev/docs/code: SvelTeX supports starry-night and recommends Shiki for richer decoration and themes.
- github.com/withastro/astro/issues/6712: A user reported a WebAssembly packaging failure in an older Vercel adapter issue that Astro closed.
- pierre.computer/writing/on-highlighting-code: Independent benchmark documents throughput and output differences.
Safe7.5
How safe is it to depend on?
Claude Opus 5.5: 7.5, likely 6.0 to 8.5
It has no advisories ever, only 4 dependencies (mainly Microsoft's vscode-textmate and vscode-oniguruma) and an MIT licence. Grammar licences are permissive and collected in a notice file. There is no OpenSSF Scorecard, a single person publishes releases, and it loads a WASM binary, so the range stays moderately wide.
- advisories total: 0 advisories
- npm dependencies: 4 dependencies
- scorecard: No Scorecard data
- github.com/wooorm/starry-night: Grammar licences stated as permissive and listed in a notice file
GPT-6.2 Sol: 7.5, likely 6.2 to 8.6
The package uses MIT with permissively licensed grammars, declares four dependencies including the WebAssembly regex engine, and has no recorded OSV advisories. The latest GitHub release points to a signed commit, and recent releases came from one visible account. The lack of a public security policy, an OpenSSF Scorecard result, and verified npm publishing details limits confidence in how a future incident would be handled.
- advisories, scorecard, npm license, npm dependencies: Zero OSV advisories, no Scorecard result, MIT, and four direct dependencies.
- github.com/wooorm/starry-night: Documents permissive grammar licences and the bundled notices.
- github.com/wooorm/starry-night/releases: Recent GitHub releases came from one account and show verified commit signatures.
- github.com/wooorm/starry-night/security: GitHub lists no security policy or published advisories.
Good
- Output closely matches GitHub's own highlighting, and it supports 600+ grammars taken from GitHub Linguist.
- It returns a hast syntax tree rather than an HTML string, so it fits rehype, virtual DOM frameworks and ANSI rendering in CLIs.
- Class-based output with the CSS it ships makes light, dark, high-contrast and colour-blind themes easy.
- It has few dependencies, ships its own types and has no known advisories.
Bad
- It is heavy and slow for the browser: about 185 kB for the core and WASM, plus up to 1.6 MB of grammars, and in one test it was about 10x slower than Prism.
- You must pin and serve the onig.wasm binary yourself, and reinstalls can break that setup.
- Its ecosystem is small: no transformers, line highlighting or theme library like Shiki's, and few known adopters.
- One person maintains it, with only a few releases a year.
The numbers
- npm downloads, 4 weeks
- 644k ×5.9 in a year
- GitHub stars
- 1.8k
- Commits, 12 months
- 18
- npm version
- 3.11.0 Aug 2026
- Versions, 12 months
- 3
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- None
- Licence
- MIT
Read on 21 November 2026 from GitHub (wooorm/starry-night), npm (@wooorm/starry-night), OSV and the OpenSSF Scorecard.