Gathering detailed insights and metrics for micromatch
An interesting fact about npm is that it started as a weekend project by its creator, Isaac Z. Schlueter, in 2009. It was officially launched in January 2010.
Gathering detailed insights and metrics for micromatch
An interesting fact about npm is that it started as a weekend project by its creator, Isaac Z. Schlueter, in 2009. It was officially launched in January 2010.
Highly optimized wildcard and glob matching library. Faster, drop-in replacement to minimatch and multimatch. Used by square, webpack, babel core, yarn, jest, ract-native, taro, bulma, browser-sync, stylelint, nyc, ava, and many others! Follow micromatch's author: https://github.com/jonschlinkert
npm install micromatch
99.2
Supply Chain
100
Quality
82
Maintenance
100
Vulnerability
100
License
2,805 Stars
604 Commits
166 Forks
23 Watching
6 Branches
34 Contributors
Updated on 22 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
19.4%
15,282,820
Compared to previous day
Last week
10.1%
95,372,795
Compared to previous week
Last month
17.2%
348,700,624
Compared to previous month
Last year
2.2%
3,321,796,634
Compared to previous year
5
Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm:
1$ npm install --save micromatch
Become a Sponsor to add your logo to this README, or any of my other projects
1const micromatch = require('micromatch'); 2// micromatch(list, patterns[, options]);
The main export takes a list of strings and one or more glob patterns:
1console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['f*', 'b*'])) //=> ['foo', 'bar', 'baz'] 2console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['*', '!b*'])) //=> ['foo', 'qux']
Use .isMatch() to for boolean matching:
1console.log(micromatch.isMatch('foo', 'f*')) //=> true 2console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
Switching from minimatch and multimatch is easy!
micromatch is a replacement for minimatch and multimatch
*
and ?
), globstars (**
) for nested directories\
or quotes.**
, *.js
)'!a/*.js'
, '*!(b).js'
)+(x|y)
, !(a|b)
)[[:alpha:][:digit:]]
)foo/{1..5}.md
, bar/{a,b,c}.js
)foo-[1-5].js
)foo/(abc|xyz).js
)You can mix and match these features to create whatever patterns you need!
(There is one notable difference between micromatch and minimatch in regards to how backslashes are handled. See the notes about backslashes for more information.)
Use micromatch.isMatch() instead of minimatch()
:
1console.log(micromatch.isMatch('foo', 'b*')); //=> false
Use micromatch.match() instead of minimatch.match()
:
1console.log(micromatch.match(['foo', 'bar'], 'b*')); //=> 'bar'
Same signature:
1console.log(micromatch(['foo', 'bar', 'baz'], ['f*', '*z'])); //=> ['foo', 'baz']
Params
list
{String|Arraypatterns
{String|Arrayoptions
{Object}: See available optionsreturns
{Array}: Returns an array of matchesExample
1const mm = require('micromatch'); 2// mm(list, patterns[, options]); 3 4console.log(mm(['a.js', 'a.txt'], ['*.js'])); 5//=> [ 'a.js' ]
Returns a matcher function from the given glob pattern
and options
. The returned function takes a string to match as its only argument and returns true if the string is a match.
Params
pattern
{String}: Glob patternoptions
{Object}returns
{Function}: Returns a matcher function.Example
1const mm = require('micromatch'); 2// mm.matcher(pattern[, options]); 3 4const isMatch = mm.matcher('*.!(*a)'); 5console.log(isMatch('a.a')); //=> false 6console.log(isMatch('a.b')); //=> true
Returns true if any of the given glob patterns
match the specified string
.
Params
str
{String}: The string to test.patterns
{String|Array}: One or more glob patterns to use for matching.[options]
{Object}: See available options.returns
{Boolean}: Returns true if any patterns match str
Example
1const mm = require('micromatch'); 2// mm.isMatch(string, patterns[, options]); 3 4console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true 5console.log(mm.isMatch('a.a', 'b.*')); //=> false
Returns a list of strings that do not match any of the given patterns
.
Params
list
{Array}: Array of strings to match.patterns
{String|Array}: One or more glob pattern to use for matching.options
{Object}: See available options for changing how matches are performedreturns
{Array}: Returns an array of strings that do not match the given patterns.Example
1const mm = require('micromatch'); 2// mm.not(list, patterns[, options]); 3 4console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); 5//=> ['b.b', 'c.c']
Returns true if the given string
contains the given pattern. Similar to .isMatch but the pattern can match any part of the string.
Params
str
{String}: The string to match.patterns
{String|Array}: Glob pattern to use for matching.options
{Object}: See available options for changing how matches are performedreturns
{Boolean}: Returns true if any of the patterns matches any part of str
.Example
1var mm = require('micromatch'); 2// mm.contains(string, pattern[, options]); 3 4console.log(mm.contains('aa/bb/cc', '*b')); 5//=> true 6console.log(mm.contains('aa/bb/cc', '*d')); 7//=> false
Filter the keys of the given object with the given glob
pattern and options
. Does not attempt to match nested keys. If you need this feature, use glob-object instead.
Params
object
{Object}: The object with keys to filter.patterns
{String|Array}: One or more glob patterns to use for matching.options
{Object}: See available options for changing how matches are performedreturns
{Object}: Returns an object with only keys that match the given patterns.Example
1const mm = require('micromatch'); 2// mm.matchKeys(object, patterns[, options]); 3 4const obj = { aa: 'a', ab: 'b', ac: 'c' }; 5console.log(mm.matchKeys(obj, '*b')); 6//=> { ab: 'b' }
Returns true if some of the strings in the given list
match any of the given glob patterns
.
Params
list
{String|Array}: The string or array of strings to test. Returns as soon as the first match is found.patterns
{String|Array}: One or more glob patterns to use for matching.options
{Object}: See available options for changing how matches are performedreturns
{Boolean}: Returns true if any patterns
matches any of the strings in list
Example
1const mm = require('micromatch'); 2// mm.some(list, patterns[, options]); 3 4console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); 5// true 6console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); 7// false
Returns true if every string in the given list
matches any of the given glob patterns
.
Params
list
{String|Array}: The string or array of strings to test.patterns
{String|Array}: One or more glob patterns to use for matching.options
{Object}: See available options for changing how matches are performedreturns
{Boolean}: Returns true if all patterns
matches all of the strings in list
Example
1const mm = require('micromatch'); 2// mm.every(list, patterns[, options]); 3 4console.log(mm.every('foo.js', ['foo.js'])); 5// true 6console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); 7// true 8console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); 9// false 10console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); 11// false
Returns true if all of the given patterns
match the specified string.
Params
str
{String|Array}: The string to test.patterns
{String|Array}: One or more glob patterns to use for matching.options
{Object}: See available options for changing how matches are performedreturns
{Boolean}: Returns true if any patterns match str
Example
1const mm = require('micromatch'); 2// mm.all(string, patterns[, options]); 3 4console.log(mm.all('foo.js', ['foo.js'])); 5// true 6 7console.log(mm.all('foo.js', ['*.js', '!foo.js'])); 8// false 9 10console.log(mm.all('foo.js', ['*.js', 'foo.js'])); 11// true 12 13console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); 14// true
Returns an array of matches captured by pattern
in string, or
null` if the pattern did not match.
Params
glob
{String}: Glob pattern to use for matching.input
{String}: String to matchoptions
{Object}: See available options for changing how matches are performedreturns
{Array|null}: Returns an array of captures if the input matches the glob pattern, otherwise null
.Example
1const mm = require('micromatch'); 2// mm.capture(pattern, string[, options]); 3 4console.log(mm.capture('test/*.js', 'test/foo.js')); 5//=> ['foo'] 6console.log(mm.capture('test/*.js', 'foo/bar.css')); 7//=> null
Create a regular expression from the given glob pattern
.
Params
pattern
{String}: A glob pattern to convert to regex.options
{Object}returns
{RegExp}: Returns a regex created from the given pattern.Example
1const mm = require('micromatch'); 2// mm.makeRe(pattern[, options]); 3 4console.log(mm.makeRe('*.js')); 5//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
Scan a glob pattern to separate the pattern into segments. Used by the split method.
Params
pattern
{String}options
{Object}returns
{Object}: Returns an object withExample
1const mm = require('micromatch'); 2const state = mm.scan(pattern[, options]);
Parse a glob pattern to create the source string for a regular expression.
Params
glob
{String}options
{Object}returns
{Object}: Returns an object with useful properties and output to be used as regex source string.Example
1const mm = require('micromatch'); 2const state = mm.parse(pattern[, options]);
Process the given brace pattern
.
Params
pattern
{String}: String with brace pattern to process.options
{Object}: Any options to change how expansion is performed. See the braces library for all available options.returns
{Array}Example
1const { braces } = require('micromatch'); 2console.log(braces('foo/{a,b,c}/bar')); 3//=> [ 'foo/(a|b|c)/bar' ] 4 5console.log(braces('foo/{a,b,c}/bar', { expand: true })); 6//=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
Option | Type | Default value | Description |
---|---|---|---|
basename | boolean | false | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, a?b would match the path /xyz/123/acb , but not /xyz/acb/123 . |
bash | boolean | false | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (** ). |
capture | boolean | undefined | Return regex matches in supporting methods. |
contains | boolean | undefined | Allows glob to match any part of the given string(s). |
cwd | string | process.cwd() | Current working directory. Used by picomatch.split() |
debug | boolean | undefined | Debug regular expressions when an error is thrown. |
dot | boolean | false | Match dotfiles. Otherwise dotfiles are ignored unless a . is explicitly defined in the pattern. |
expandRange | function | undefined | Custom function for expanding ranges in brace patterns, such as {a..z} . The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. This option is overridden by the expandBrace option. |
failglob | boolean | false | Similar to the failglob behavior in Bash, throws an error when no matches are found. Based on the bash option of the same name. |
fastpaths | boolean | true | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to false . |
flags | boolean | undefined | Regex flags to use in the generated regex. If defined, the nocase option will be overridden. |
format | function | undefined | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. |
ignore | array|string | undefined | One or more glob patterns for excluding strings that should not be matched from the result. |
keepQuotes | boolean | false | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. |
literalBrackets | boolean | undefined | When true , brackets in the glob pattern will be escaped so that only literal brackets will be matched. |
lookbehinds | boolean | true | Support regex positive and negative lookbehinds. Note that you must be using Node 8.1.10 or higher to enable regex lookbehinds. |
matchBase | boolean | false | Alias for basename |
maxLength | boolean | 65536 | Limit the max length of the input string. An error is thrown if the input string is longer than this value. |
nobrace | boolean | false | Disable brace matching, so that {a,b} and {1..3} would be treated as literal characters. |
nobracket | boolean | undefined | Disable matching with regex brackets. |
nocase | boolean | false | Perform case-insensitive matching. Equivalent to the regex i flag. Note that this option is ignored when the flags option is defined. |
nodupes | boolean | true | Deprecated, use nounique instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. |
noext | boolean | false | Alias for noextglob |
noextglob | boolean | false | Disable support for matching with extglobs (like +(a|b) ) |
noglobstar | boolean | false | Disable support for matching nested directories with globstars (** ) |
nonegate | boolean | false | Disable support for negating with leading ! |
noquantifiers | boolean | false | Disable support for regex quantifiers (like a{1,2} ) and treat them as brace patterns to be expanded. |
onIgnore | function | undefined | Function to be called on ignored items. |
onMatch | function | undefined | Function to be called on matched items. |
onResult | function | undefined | Function to be called on all items, regardless of whether or not they are matched or ignored. |
posix | boolean | false | Support POSIX character classes ("posix brackets"). |
posixSlashes | boolean | undefined | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
prepend | string | undefined | String to prepend to the generated regex used for matching. |
regex | boolean | false | Use regular expression rules for + (instead of matching literal + ), and for stars that follow closing parentheses or brackets (as in )* and ]* ). |
strictBrackets | boolean | undefined | Throw an error if brackets, braces, or parens are imbalanced. |
strictSlashes | boolean | undefined | When true, picomatch won't match trailing slashes with single stars. |
unescape | boolean | undefined | Remove preceding backslashes from escaped glob characters before creating the regular expression to perform matches. |
unixify | boolean | undefined | Alias for posixSlashes , for backwards compatitibility. |
Allow glob patterns without slashes to match a file path based on its basename. Same behavior as minimatch option matchBase
.
Type: Boolean
Default: false
Example
1micromatch(['a/b.js', 'a/c.md'], '*.js'); 2//=> [] 3 4micromatch(['a/b.js', 'a/c.md'], '*.js', { basename: true }); 5//=> ['a/b.js']
Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression does not repeat the bracketed characters. Instead, the star is treated the same as any other star.
Type: Boolean
Default: true
Example
1const files = ['abc', 'ajz']; 2console.log(micromatch(files, '[a-c]*')); 3//=> ['abc', 'ajz'] 4 5console.log(micromatch(files, '[a-c]*', { bash: false }));
Type: function
Default: undefined
Custom function for expanding ranges in brace patterns. The fill-range library is ideal for this purpose, or you can use custom code to do whatever you need.
Example
The following example shows how to create a glob that matches a numeric folder name between 01
and 25
, with leading zeros.
1const fill = require('fill-range'); 2const regex = micromatch.makeRe('foo/{01..25}/bar', { 3 expandRange(a, b) { 4 return `(${fill(a, b, { toRegex: true })})`; 5 } 6}); 7 8console.log(regex) 9//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ 10 11console.log(regex.test('foo/00/bar')) // false 12console.log(regex.test('foo/01/bar')) // true 13console.log(regex.test('foo/10/bar')) // true 14console.log(regex.test('foo/22/bar')) // true 15console.log(regex.test('foo/25/bar')) // true 16console.log(regex.test('foo/26/bar')) // false
Type: function
Default: undefined
Custom function for formatting strings before they're matched.
Example
1// strip leading './' from strings 2const format = str => str.replace(/^\.\//, ''); 3const isMatch = picomatch('foo/*.js', { format }); 4console.log(isMatch('./foo/bar.js')) //=> true
String or array of glob patterns to match files to ignore.
Type: String|Array
Default: undefined
1const isMatch = micromatch.matcher('*', { ignore: 'f*' }); 2console.log(isMatch('foo')) //=> false 3console.log(isMatch('bar')) //=> true 4console.log(isMatch('baz')) //=> true
Alias for options.basename.
Disable extglob support, so that extglobs are regarded as literal characters.
Type: Boolean
Default: undefined
Examples
1console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)')); 2//=> ['a/b', 'a/!(z)'] 3 4console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)', { noextglob: true })); 5//=> ['a/!(z)'] (matches only as literal characters)
Disallow negation (!
) patterns, and treat leading !
as a literal character to match.
Type: Boolean
Default: undefined
Disable matching with globstars (**
).
Type: Boolean
Default: undefined
1micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**'); 2//=> ['a/b', 'a/b/c', 'a/b/c/d'] 3 4micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true}); 5//=> ['a/b']
Alias for options.nullglob.
If true
, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as minimatch option nonull
.
Type: Boolean
Default: undefined
1const onIgnore = ({ glob, regex, input, output }) => { 2 console.log({ glob, regex, input, output }); 3 // { glob: '*', regex: /^(?:(?!\.)(?=.)[^\/]*?\/?)$/, input: 'foo', output: 'foo' } 4}; 5 6const isMatch = micromatch.matcher('*', { onIgnore, ignore: 'f*' }); 7isMatch('foo'); 8isMatch('bar'); 9isMatch('baz');
1const onMatch = ({ glob, regex, input, output }) => { 2 console.log({ input, output }); 3 // { input: 'some\\path', output: 'some/path' } 4 // { input: 'some\\path', output: 'some/path' } 5 // { input: 'some\\path', output: 'some/path' } 6}; 7 8const isMatch = micromatch.matcher('**', { onMatch, posixSlashes: true }); 9isMatch('some\\path'); 10isMatch('some\\path'); 11isMatch('some\\path');
1const onResult = ({ glob, regex, input, output }) => { 2 console.log({ glob, regex, input, output }); 3}; 4 5const isMatch = micromatch('*', { onResult, ignore: 'f*' }); 6isMatch('foo'); 7isMatch('bar'); 8isMatch('baz');
Convert path separators on returned files to posix/unix-style forward slashes. Aliased as unixify
for backwards compatibility.
Type: Boolean
Default: true
on windows, false
everywhere else.
Example
1console.log(micromatch.match(['a\\b\\c'], 'a/**')); 2//=> ['a/b/c'] 3 4console.log(micromatch.match(['a\\b\\c'], { posixSlashes: false })); 5//=> ['a\\b\\c']
Remove backslashes from escaped glob characters before creating the regular expression to perform matches.
Type: Boolean
Default: undefined
Example
In this example we want to match a literal *
:
1console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c')); 2//=> ['a\\*c'] 3 4console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c', { unescape: true })); 5//=> ['a*c']
Micromatch supports the following extended globbing features.
Extended globbing, as described by the bash man page:
pattern | regex equivalent | description |
---|---|---|
?(pattern) | (pattern)? | Matches zero or one occurrence of the given patterns |
*(pattern) | (pattern)* | Matches zero or more occurrences of the given patterns |
+(pattern) | (pattern)+ | Matches one or more occurrences of the given patterns |
@(pattern) | (pattern) * | Matches one of the given patterns |
!(pattern) | N/A (equivalent regex is much more complicated) | Matches anything except one of the given patterns |
* Note that @
isn't a regex character.
Brace patterns can be used to match specific ranges or sets of characters.
Example
The pattern {f,b}*/{1..3}/{b,q}*
would match any of following strings:
foo/1/bar
foo/2/bar
foo/3/bar
baz/1/qux
baz/2/qux
baz/3/qux
Visit braces to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues.
Given the list: ['a.js', 'b.js', 'c.js', 'd.js', 'E.js']
:
[ac].js
: matches both a
and c
, returning ['a.js', 'c.js']
[b-d].js
: matches from b
to d
, returning ['b.js', 'c.js', 'd.js']
a/[A-Z].js
: matches and uppercase letter, returning ['a/E.md']
Learn about regex character classes.
Given ['a.js', 'b.js', 'c.js', 'd.js', 'E.js']
:
(a|c).js
: would match either a
or c
, returning ['a.js', 'c.js']
(b|d).js
: would match either b
or d
, returning ['b.js', 'd.js']
(b|[A-Z]).js
: would match either b
or an uppercase letter, returning ['b.js', 'E.js']
As with regex, parens can be nested, so patterns like ((a|b)|c)/b
will work. Although brace expansion might be friendlier to use, depending on preference.
POSIX brackets are intended to be more user-friendly than regex character classes. This of course is in the eye of the beholder.
Example
1console.log(micromatch.isMatch('a1', '[[:alpha:][:digit:]]')) //=> true 2console.log(micromatch.isMatch('a1', '[[:alpha:][:alpha:]]')) //=> false
Whenever possible matching behavior is based on behavior Bash 4.3, which is mostly consistent with minimatch.
However, it's suprising how many edge cases and rabbit holes there are with glob matching, and since there is no real glob specification, and micromatch is more accurate than both Bash and minimatch, there are cases where best-guesses were made for behavior. In a few cases where Bash had no answers, we used wildmatch (used by git) as a fallback.
There is an important, notable difference between minimatch and micromatch in regards to how backslashes are handled in glob patterns.
We made this decision for micromatch for a couple of reasons:
A note about joining paths to globs
Note that when you pass something like path.join('foo', '*')
to micromatch, you are creating a filepath and expecting it to still work as a glob pattern. This causes problems on windows, since the path.sep
is \\
.
In other words, since \\
is reserved as an escape character in globs, on windows path.join('foo', '*')
would result in foo\\*
, which tells micromatch to match *
as a literal character. This is the same behavior as bash.
To solve this, you might be inspired to do something like 'foo\\*'.replace(/\\/g, '/')
, but this causes another, potentially much more serious, problem.
Install dependencies for running benchmarks:
1$ cd bench && npm install
Run the benchmarks:
1$ npm run bench
As of August 23, 2024 (longer bars are better):
1# .makeRe star 2 micromatch x 2,232,802 ops/sec ±2.34% (89 runs sampled)) 3 minimatch x 781,018 ops/sec ±6.74% (92 runs sampled)) 4 5# .makeRe star; dot=true 6 micromatch x 1,863,453 ops/sec ±0.74% (93 runs sampled) 7 minimatch x 723,105 ops/sec ±0.75% (93 runs sampled) 8 9# .makeRe globstar 10 micromatch x 1,624,179 ops/sec ±2.22% (91 runs sampled) 11 minimatch x 1,117,230 ops/sec ±2.78% (86 runs sampled)) 12 13# .makeRe globstars 14 micromatch x 1,658,642 ops/sec ±0.86% (92 runs sampled) 15 minimatch x 741,224 ops/sec ±1.24% (89 runs sampled)) 16 17# .makeRe with leading star 18 micromatch x 1,525,014 ops/sec ±1.63% (90 runs sampled) 19 minimatch x 561,074 ops/sec ±3.07% (89 runs sampled) 20 21# .makeRe - braces 22 micromatch x 172,478 ops/sec ±2.37% (78 runs sampled) 23 minimatch x 96,087 ops/sec ±2.34% (88 runs sampled))) 24 25# .makeRe braces - range (expanded) 26 micromatch x 26,973 ops/sec ±0.84% (89 runs sampled) 27 minimatch x 3,023 ops/sec ±0.99% (90 runs sampled)) 28 29# .makeRe braces - range (compiled) 30 micromatch x 152,892 ops/sec ±1.67% (83 runs sampled) 31 minimatch x 992 ops/sec ±3.50% (89 runs sampled)d)) 32 33# .makeRe braces - nested ranges (expanded) 34 micromatch x 15,816 ops/sec ±13.05% (80 runs sampled) 35 minimatch x 2,953 ops/sec ±1.64% (91 runs sampled) 36 37# .makeRe braces - nested ranges (compiled) 38 micromatch x 110,881 ops/sec ±1.85% (82 runs sampled) 39 minimatch x 1,008 ops/sec ±1.51% (91 runs sampled) 40 41# .makeRe braces - set (compiled) 42 micromatch x 134,930 ops/sec ±3.54% (63 runs sampled)) 43 minimatch x 43,242 ops/sec ±0.60% (93 runs sampled) 44 45# .makeRe braces - nested sets (compiled) 46 micromatch x 94,455 ops/sec ±1.74% (69 runs sampled)) 47 minimatch x 27,720 ops/sec ±1.84% (93 runs sampled))
All contributions are welcome! Please read the contributing guide to get started.
Bug reports
Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please:
Platform issues
It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated).
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
step
to… more | homepageJon Schlinkert
Copyright © 2024, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on August 23, 2024.
The latest stable version of the package.
Stable Version
1
5.3/10
Summary
Regular Expression Denial of Service (ReDoS) in micromatch
Affected Versions
< 4.0.8
Patched Versions
4.0.8
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 5/20 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
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 2024-11-18
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 Morenanomatch
Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)
micromatchtmp
Fork of micromatch
@types/micromatch
TypeScript definitions for micromatch
expand-range
Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by micromatch.