Gathering detailed insights and metrics for matcher
Gathering detailed insights and metrics for matcher
Gathering detailed insights and metrics for matcher
Gathering detailed insights and metrics for matcher
npm install matcher
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (97.26%)
TypeScript (2.74%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
540 Stars
42 Commits
29 Forks
5 Watchers
1 Branches
12 Contributors
Updated on May 15, 2025
Latest Version
5.0.0
Package Id
matcher@5.0.0
Size
3.81 kB
NPM Version
7.20.3
Node Version
12.22.1
Published on
Oct 03, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Simple wildcard matching
Useful when you want to accept loose string input and regexes/globs are too convoluted.
1npm install matcher
1import {matcher, isMatch} from 'matcher'; 2 3matcher(['foo', 'bar', 'moo'], ['*oo', '!foo']); 4//=> ['moo'] 5 6matcher(['foo', 'bar', 'moo'], ['!*oo']); 7//=> ['bar'] 8 9matcher('moo', ['']); 10//=> [] 11 12matcher('moo', []); 13//=> [] 14 15matcher([''], ['']); 16//=> [''] 17 18isMatch('unicorn', 'uni*'); 19//=> true 20 21isMatch('unicorn', '*corn'); 22//=> true 23 24isMatch('unicorn', 'un*rn'); 25//=> true 26 27isMatch('rainbow', '!unicorn'); 28//=> true 29 30isMatch('foo bar baz', 'foo b* b*'); 31//=> true 32 33isMatch('unicorn', 'uni\\*'); 34//=> false 35 36isMatch(['foo', 'bar'], 'f*'); 37//=> true 38 39isMatch(['foo', 'bar'], ['a*', 'b*']); 40//=> true 41 42isMatch('unicorn', ['']); 43//=> false 44 45isMatch('unicorn', []); 46//=> false 47 48isMatch([], 'bar'); 49//=> false 50 51isMatch([], []); 52//=> false 53 54isMatch('', ''); 55//=> true
It matches even across newlines. For example, foo*r
will match foo\nbar
.
Accepts a string or an array of strings for both inputs
and patterns
.
Returns an array of inputs
filtered based on the patterns
.
Accepts a string or an array of strings for both inputs
and patterns
.
Returns a boolean
of whether any of given inputs
matches all the patterns
.
Type: string | string[]
The string or array of strings to match.
Type: object
Type: boolean
Default: false
Treat uppercase and lowercase characters as being the same.
Ensure you use this correctly. For example, files and directories should be matched case-insensitively, while most often, object keys should be matched case-sensitively.
1import {isMatch} from 'matcher'; 2 3isMatch('UNICORN', 'UNI*', {caseSensitive: true}); 4//=> true 5 6isMatch('UNICORN', 'unicorn', {caseSensitive: true}); 7//=> false 8 9isMatch('unicorn', ['tri*', 'UNI*'], {caseSensitive: true}); 10//=> false
Type: boolean
Default: false
Require all negated patterns to not match and any normal patterns to match at least once. Otherwise, it will be a no-match condition.
1import {matcher} from 'matcher'; 2 3// Find text strings containing both "edge" and "tiger" in arbitrary order, but not "stunt". 4const demo = (strings) => matcher(strings, ['*edge*', '*tiger*', '!*stunt*'], {allPatterns: true}); 5 6demo(['Hey, tiger!', 'tiger has edge over hyenas', 'pushing a tiger over the edge is a stunt']); 7//=> ['tiger has edge over hyenas']
1import {matcher} from 'matcher'; 2 3matcher(['foo', 'for', 'bar'], ['f*', 'b*', '!x*'], {allPatterns: true}); 4//=> ['foo', 'for', 'bar'] 5 6matcher(['foo', 'for', 'bar'], ['f*'], {allPatterns: true}); 7//=> []
Type: string | string[]
Use *
to match zero or more characters.
A leading !
negates the pattern.
An input string will be omitted, if it does not match any non-negated patterns present, or if it matches a negated pattern, or if no pattern is present.
1npm run bench
minimatch.match()
with support for multiple patternsNo vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More