https://github.com/auritylab/domain-matcher
Check if given domain/url matches against domain patterns.
https://github.com/auritylab/domain-matcher
domain domain-matcher matcher wildcard
Last synced: 11 months ago
JSON representation
Check if given domain/url matches against domain patterns.
- Host: GitHub
- URL: https://github.com/auritylab/domain-matcher
- Owner: AurityLab
- License: apache-2.0
- Created: 2019-01-04T14:13:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-31T04:00:33.000Z (about 3 years ago)
- Last Synced: 2024-10-28T22:10:30.005Z (over 1 year ago)
- Topics: domain, domain-matcher, matcher, wildcard
- Language: TypeScript
- Homepage:
- Size: 212 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Domain matcher
[](https://travis-ci.org/AurityLab/domain-matcher)
[](https://www.npmjs.com/package/domain-matcher)
[](https://www.npmjs.com/package/domain-matcher)
Check if given domain/url matches against domain patterns.
## Features
* Only ~3 kB (**~1.2 kB gzipped**).
* Suitable for browser environments.
* No additional dependencies.
## Install
With NPM:
```bash
$ npm install domain-matcher
```
With Yarn:
```bash
$ yarn add domain-matcher
```
## Usage
```javascript
import { match } from 'domain-matcher'
match('domain.matcher.com', '*.matcher.com') // => true
match('matcher.com', '*.matcher.com') // => false
match('matcher.com', '*.matcher.com', '*.com') // => true (Only '*.com' matches)
```