# wildcard-domain-matcher

> This module is only for wildcard domain matching and may not work fine with invalid domain name characters or other usage for efficient reason.

Latest version **1.0.0** (published 2019-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install wildcard-domain-matcher
pnpm add wildcard-domain-matcher
yarn add wildcard-domain-matcher
bun add wildcard-domain-matcher
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-03-15 |
| First published | 2019-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | luojia@luojia.me |
| Maintainers | luojia |
| Keywords | wildcard, domain |

## Links

- npm: https://www.npmjs.com/package/wildcard-domain-matcher
- Repository: https://github.com/JiaJiaJiang/node-wildcard-domain-matcher
- Homepage: https://github.com/JiaJiaJiang/node-wildcard-domain-matcher#readme
- Issues: https://github.com/JiaJiaJiang/node-wildcard-domain-matcher/issues
- npm.io page: https://npm.io/package/wildcard-domain-matcher

## Recent versions

- 1.0.0 (latest) — 2019-03-15

## README

# node-wildcard-domain-matcher

This module is only for wildcard domain matching and may not work fine with invalid domain name characters or other usage for efficient reason.

## class Matcher(opt)

* test([string]domain,[string]pattern,[bool]leadingWildCardSubdomainOnly=false)
* match([string]domain[array],patterns,[bool]leadingWildCardSubdomainOnly=false)

See the examples for usage

## examples

```javascript
var Matcher=require("wildcard-domain-matcher");

var matcher=new Matcher();
//patterns are cached as regexp in the object,if you don't want that use
var matcher=new Matcher({noCache:true);

matcher.test("luojia.me","*.luojia.me");
//true

//leading *. will only match subdomains if leadingWildCardSubdomainOnly=true
matcher.test("luojia.me","*.luojia.me",true);
//false

//return the first pattern matched in the list
matcher.match("luojia.me",["*.luojia.me","luojia.me","*"],true);
//"luojia.me"

```

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