# @remusao/url-match-patterns

> Test URLs against match patterns

Latest version **2.1.0** (published 2025-05-16) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install @remusao/url-match-patterns
pnpm add @remusao/url-match-patterns
yarn add @remusao/url-match-patterns
bun add @remusao/url-match-patterns
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2025-05-16 |
| First published | 2020-06-14 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 46.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Rémi Berson <remi@cliqz.com> |
| Maintainers | remusao |

## Links

- npm: https://www.npmjs.com/package/@remusao/url-match-patterns
- Repository: https://github.com/remusao/mono
- Homepage: https://github.com/remusao/mono#readme
- Issues: https://github.com/remusao/mono/issues
- npm.io page: https://npm.io/package/@remusao/url-match-patterns

## Recent versions

- 2.1.0 (latest) — 2025-05-16
- 1.1.1-canary.309.bb92957ae635c786e8798fd12cc9d8a0213d624f.0 (canary) — 2020-11-03
- 2.0.0 — 2025-04-07
- 1.2.0 — 2024-07-11
- 1.1.1 — 2020-11-03
- 1.1.1-canary.307.a8b715240fbe1ea8f6c58b1e778de472a237b6c3.0 — 2020-11-03
- 1.1.1-canary.306.92331cfe30132d83f557c212e90b7870a054712c.0 — 2020-11-02
- 1.1.1-canary.305.9461d0d8204f319a81ae7ecc2b873c3deac2bb3b.0 — 2020-11-02
- 1.1.1-canary.304.00af04df77e6c80e2417971e89e371604f318e4a.0 — 2020-11-01
- 1.1.1-canary.303.d5405a9efbd58804427096689a1e8df212ec2458.0 — 2020-10-30
- 1.1.1-canary.302.28c36e01aed2a0381b38131546b5713389a1d53c.0 — 2020-10-29
- 1.1.1-canary.301.dee75a3ec5e278abf0bec136bf0edda997a4775a.0 — 2020-10-29
- 1.1.1-canary.300.cf6720273d182293ff3e38d696a4127b4d5ef888.0 — 2020-10-28
- 1.1.1-canary.299.b9646709bc95e7c9eb5d634a596746ddcbb42030.0 — 2020-10-27
- 1.1.1-canary.298.bc7d2af540e64727209963e40073199e30ede900.0 — 2020-10-27
- … 87 more at https://npm.io/package/@remusao/url-match-patterns/versions

## README

# `@remusao/url-match-patterns`

> Test URLs against match patterns, as defined by [Google](https://developer.chrome.com/extensions/match_patterns) and [Mozilla](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Match_patterns).

```typescript
import match, { Pattern } from '@remusao/url-match-patterns';

// check that a url matches
match('*://*/*', 'https://www.example.com'); // true

// pre-compile pattern for faster performance
const pattern = new Pattern('*://*/*');
pattern.match('https://www.example.com'); // true

// More examples
match('<all_urls>', 'https://www.example.com'); // true
match('https://example.com/*', 'https://www.example.com'); // false
match('https://*.example.com/*', 'https://www.example.com'); // true
```

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