# @flexent/pathmatcher

> Path matching utils for pathname-based routing

Latest version **2.16.1** (published 2026-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @flexent/pathmatcher
pnpm add @flexent/pathmatcher
yarn add @flexent/pathmatcher
bun add @flexent/pathmatcher
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.16.1 |
| Published | 2026-08-27 |
| First published | 2022-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Boris Okunskiy |
| Maintainers | inca |

## Links

- npm: https://www.npmjs.com/package/@flexent/pathmatcher
- npm.io page: https://npm.io/package/@flexent/pathmatcher

## Recent versions

- 2.16.1 (latest) — 2026-08-27
- 2.16.0 — 2026-08-10
- 2.15.1 — 2026-08-08
- 2.15.0 — 2026-08-03
- 2.14.1 — 2026-08-03
- 2.14.0 — 2026-07-10
- 2.12.0 — 2026-07-10
- 2.11.0 — 2026-07-09
- 2.10.0 — 2026-06-30
- 2.9.5 — 2026-06-23
- 2.9.4 — 2026-06-18
- 2.9.3 — 2026-06-18
- 2.9.1 — 2026-06-18
- 2.9.0 — 2026-06-18
- 2.8.0 — 2026-06-17
- … 17 more at https://npm.io/package/@flexent/pathmatcher/versions

## README

# @flexent/pathmatcher

Path matching utils for pathname-based routing.

## Key features

- 🔥 Zero dependencies
- 👗 Very slim — just few hundred bytes gzipped
- ⚡️ Blazing fast
- 💻 Works in browser
- 🗜 Tidy and compact
- 🌳 Ergonomic
- 🔬 Strongly typed
- 💎 Very strict feature set

## Usage

```ts
matchPath('/users/{name}', '/users/joe');   // { name: 'joe' }
matchPath('/users/{name}', '/users/', );    // null — no match
matchPath('/users', '/users');              // {} — match with no parameters
matchPath('/users/', '/users');             // {} — note: trailing slashes are ignored both ways

// Prefix mode — match only the beginning of the path
matchPath('/users', '/users/foo', true);    // {} — match with no parameters
```

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