# twoslash

> Markup for generating rich type information in your documentations ahead of time

Latest version **0.3.9** (published 2026-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install twoslash
pnpm add twoslash
yarn add twoslash
bun add twoslash
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.9 |
| Published | 2026-06-22 |
| First published | 2024-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 135.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 941 |
| Author | TypeScript team |
| Maintainers | orta, antfu |

## Links

- npm: https://www.npmjs.com/package/twoslash
- Repository: https://github.com/twoslashes/twoslash
- Issues: https://github.com/twoslashes/twoslash/issues
- npm.io page: https://npm.io/package/twoslash

## Dependencies (2)

- [@typescript/vfs](https://npm.io/package/@typescript/vfs.md) ^1.6.4
- [twoslash-protocol](https://npm.io/package/twoslash-protocol.md) 0.3.9

## Recent versions

- 0.3.9 (latest) — 2026-06-22
- 0.3.8 — 2026-04-16
- 0.3.7 — 2026-04-10
- 0.3.6 — 2025-12-21
- 0.3.4 — 2025-08-11
- 0.3.3 — 2025-07-22
- 0.3.2 — 2025-07-03
- 0.3.1 — 2025-02-27
- 0.3.0 — 2025-02-26
- 0.2.12 — 2024-09-28
- 0.2.11 — 2024-09-07
- 0.2.10 — 2024-09-01
- 0.2.9 — 2024-06-22
- 0.2.8 — 2024-06-11
- 0.2.7 — 2024-06-09
- … 18 more at https://npm.io/package/twoslash/versions

## README

<img src="https://twoslash.netlify.app/logo.svg" alt="Twoslash Logo" width="150">

# Twoslash

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![JSDocs][jsdocs-src]][jsdocs-href]
[![License][license-src]][license-href]

[📚 Documentation](https://twoslash.netlify.app/) | [⚙️ Migration Guide](https://twoslash.netlify.app/guide/migrate)

A markup format for TypeScript code, ideal for creating self-contained code samples which let the TypeScript compiler do the extra leg-work. Inspired by the [fourslash test system](https://github.com/orta/typescript-notes/blob/master/systems/testing/fourslash.md).

This project is the successor of [`@typescript/twoslash`](https://github.com/microsoft/TypeScript-Website/tree/v2/packages/ts-twoslasher).

## License

MIT License © [Orta Therox](https://github.com/orta), [Anthony Fu](https://github.com/antfu), Microsoft Corporation

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/twoslash?style=flat&colorA=161514&colorB=EAB836
[npm-version-href]: https://npmjs.com/package/twoslash
[npm-downloads-src]: https://img.shields.io/npm/dm/twoslash?style=flat&colorA=161514&colorB=E66041
[npm-downloads-href]: https://npmjs.com/package/twoslash
[bundle-src]: https://img.shields.io/bundlephobia/minzip/twoslash?style=flat&colorA=161514&colorB=45627B&label=minzip
[bundle-href]: https://bundlephobia.com/result?p=twoslash
[license-src]: https://img.shields.io/github/license/twoslashes/twoslash.svg?style=flat&colorA=161514&colorB=45627B
[license-href]: https://github.com/twoslashes/twoslash/blob/main/LICENSE
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-161514?style=flat&colorA=161514&colorB=EAB836
[jsdocs-href]: https://www.jsdocs.io/package/twoslash

---
_Source: https://npm.io/package/twoslash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
