Skip to content
JS
Package

ts-pattern

The exhaustive Pattern Matching library for TypeScript.

v5.9.0, 26 Oct 2025MITESM + CommonJSTypes: BundledTypeScript tooling
$ npm install ts-pattern

Key numbers

As of 25 Sept 2026
Weekly downloads
4.5m
+111% over 12 months
Gzip bundle size
-
No Bundlephobia data
Dependencies
0
Direct, from package.json
Last release
10 months ago
v5.9.0
GitHub stars
15.2k
172 forks
Open issues / PRs
53 / 24
Contributors
-
Commits, last 52 weeks
22

Downloads

Last week 2026-09-15 to 2026-09-21
02m4m6m8mSept 2025Mar 2026Sept 2026High 7.9m (18 Aug 2026)Low 1.3m (23 Dec 2025)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

4,539,003 downloads last week, 23,385,143 in the last month. The 12-month change of +111% compares the average of the last 4 weeks with the first 4 weeks of the series.

Releases, last 12 months
196 in total
Latest version
5.9.0, 26 Oct 202510 months ago
First published
24 May 2020
Last push to GitHub
11 Sept 202613 days before the snapshot
Repository archived
No
Open issues
53
Open pull requests
24
Commits, last 52 weeks
22
Dependents on npm
1,248

Major versions

  1. v5 first release 5.0.0, 13 Jun 2023
  2. v4 first release 4.0.1, 26 Mar 2022
  3. v3 first release 3.0.1, 14 Mar 2021
  4. v2 first release 2.1.0, 30 Jan 2021
  5. v1 first release 1.0.0, 10 Jun 2020
  6. v0 first release 0.0.1, 24 May 2020

Recent releases

VersionPublished
5.9.026 Oct 2025
5.8.026 Jul 2025
5.7.118 May 2025
5.7.028 Mar 2025
5.6.221 Jan 2025
5.6.119 Jan 2025
5.6.015 Dec 2024
5.5.014 Oct 2024
5.4.025 Sept 2024
5.3.111 Aug 2024
5.3.011 Aug 2024
5.2.012 Jun 2024
5.1.223 May 2024
5.1.16 Apr 2024
Module format
ESM + CommonJSFrom package.json type, main and exports fields
TypeScript types
Bundled
Node.js engine range
Not declared
Runtimes
-
Unpacked size (npm)
442 kB
Dependencies (0)
None
npm install ts-pattern
  • jsDelivrhttps://cdn.jsdelivr.net/npm/ts-pattern@5.9.0/
  • unpkghttps://unpkg.com/ts-pattern@5.9.0/
  • esm.shhttps://esm.sh/ts-pattern@5.9.0
Sources: npm registry, npm downloads API, GitHub API. Data fetched 25 Sept 2026.

Indexability: Indexed.