---
title: "ts-pattern"
description: "A type-safe pattern-matching library."
pagination: false
---

{/* Generated from content/. Edit the catalog, not this page. */}

<PurposeNote title="Good for">Expressing structured branching with exhaustive matching over TypeScript values.</PurposeNote>

## What it does

A type-safe pattern-matching library.

## When it fits

Expressing structured branching with exhaustive matching over TypeScript values.

## Other options in this category

<div data-pagefind-ignore>

- [Effect](/typescript/effect) — Structuring asynchronous work, errors, dependencies, and resource lifecycles.
- [Total TypeScript TSConfig](/typescript/total-typescript-tsconfig) — Starting projects with consistent compiler settings.
- [True Myth](/typescript/true-myth) — Representing absence and failure explicitly in TypeScript application logic.
- [ts-expect](/typescript/ts-expect) — Checking that public types behave as intended during compilation.
- [ts-toolbelt](/typescript/ts-toolbelt) — Building complex type transformations from reusable type-level operations.

</div>

## Source

[Project source for ts-pattern ↗](https://github.com/gvergnaud/ts-pattern)

Editorial overview reviewed on October 24, 2026. Follow the source for current setup, compatibility, and licensing.

[Make application logic type-safe →](/tasks/make-application-logic-type-safe)

[All typescript &amp; typed logic options →](/typescript)
