# shikijs/twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples

Repository: https://github.com/shikijs/twoslash
Canonical: https://ross.abutalabs.com/products/twoslash
Homepage: https://shikijs.github.io/twoslash/
Language: TypeScript
License: MIT
License Family: permissive
Topics: shiki-twoslash, remark, docusaurus, markdown-it, markdown-it-plugin, remark-plugin, typescript, javascript, shiki
Archived: true
Last push: 2024-02-19T12:13:47+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 1925, "days_push": 926, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1142, forks 48 (observed 2026-08-28T04:03:44.700990+00:00)

## What it is
Shiki Twoslash combines the Shiki syntax highlighter with the TypeScript compiler to generate statically rendered, type-aware code samples for documentation. It ships plugins for markdown renderers (remark, markdown-it) and static site generators (Docusaurus, Gatsby, 11ty, VuePress, Hexo), plus a CLI and a VS Code extension.

## Use cases
- add type hover info and compiler errors to code samples in docs
- statically syntax highlight markdown code blocks with VS Code themes
- verify TypeScript code examples still compile across versions
- render twoslash-annotated code blocks in Docusaurus or Gatsby
- convert markdown and ts/tsx files to highlighted HTML via CLI

## When to avoid
- you use Shiki v1.0 or later - the integration moved into Shiki's monorepo as a transformer
- you need highlighting for non-TypeScript/JavaScript samples with type information
- your docs stack isn't covered by the available renderer plugins

## Facets
- artifact type: library
- maturity: maintenance
- function: documentation, markdown, parser, cli, plugin-system, developer-tools
- domain: documentation, developer-tools, web-development, programming-languages
- platform: cli
- tags: syntax-highlighting, shiki, twoslash, typescript-compiler, code-samples, remark-plugin, markdown-it-plugin, docusaurus, gatsby, vscode-extension, nodejs, web-server

## Member repositories
- shikijs/twoslash (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:44.700990+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:35:16.880782+00:00, confidence not recorded.
  - readme: https://github.com/shikijs/twoslash (fetched 2026-08-28T04:03:44.700990+00:00, sha 053bb419f69d)
  - homepage: https://shikijs.github.io/twoslash/ (fetched 2026-08-29T12:40:32.485616+00:00, sha e9fb0ff25c64)
- Data as of 2026-08-30T08:39:29.467469+00:00.
