Socket
Book a DemoInstallSign in
Socket

url-match-patterns

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-match-patterns

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

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
1.8K
-35.53%
Maintainers
1
Weekly downloads
 
Created
Source

url-match-patterns

A node module for testing URLs against match patterns, as defined by Google and Mozilla.

Example

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.

Keywords

match

FAQs

Package last updated on 24 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts