# url-match-patterns

> A module for testing URLs against Chrome and Firefox match patterns.

Latest version **0.2.0** (published 2017-05-24) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2017-05-24 |
| First published | 2017-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/url-match-patterns) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Nicholas Clawson |
| Maintainers | nickclaw |
| Keywords | match, patterns, chrome, firefox, extension, WebExtensions, url |

## Links

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

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.3.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2017-05-24

## README

# url-match-patterns

A node module for testing 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).

### Example

```js
import match from 'url-match-patterns';

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

// or build a reusable function
const matches = match('*://*/');
matches('https://www.example.com'); // true

```

### API

##### `match(pattern, url) -> Boolean`
Compares a pattern against a URL. Returns `true` if the pattern matches
or `false` if it doesn't. Will throw an `AssertionError` if your pattern
is invalid.

##### `match(pattern) -> Function`
Create a reusable match function for a pattern. This will be faster since
it only has to initialize once. Will throw an `AssertionError` if your pattern
is invalid.

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