Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 923 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 923 Bytes

Domain matcher

Build Status npm npm type definitions

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:

$ npm install domain-matcher

With Yarn:

$ yarn add domain-matcher

Usage

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)