Gathering detailed insights and metrics for anymatch
Gathering detailed insights and metrics for anymatch
Gathering detailed insights and metrics for anymatch
Gathering detailed insights and metrics for anymatch
@types/anymatch
Stub TypeScript definitions entry for anymatch, which provides its own types definitions
glob-stream
Readable streamx interface over anymatch.
vscode-anymatch
Matches strings against configurable strings, globs, regular expressions, and/or functions
rescript-anymatch
ReScript bindings for anymatch
‼️ Matches strings against configurable strings, globs, regular expressions, and/or functions
npm install anymatch
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
399 Stars
178 Commits
40 Forks
13 Watchers
1 Branches
17 Contributors
Updated on Jul 13, 2025
Latest Version
3.1.3
Package Id
anymatch@3.1.3
Unpacked Size
9.43 kB
Size
3.57 kB
File Count
5
NPM Version
8.11.0
Node Version
16.14.2
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
2
Javascript module to match a string against a regular expression, glob, string, or function that takes the string as an argument and returns a truthy or falsy value. The matcher can also be an array of any or all of these. Useful for allowing a very flexible user-defined config to define things like file paths.
Note: This module has Bash-parity, please be aware that Windows-style backslashes are not supported as separators. See https://github.com/micromatch/micromatch#backslashes for more information.
1npm install anymatch
testString
for non-function matchers, while the entire array will be applied
as the arguments for function matchers.1const anymatch = require('anymatch'); 2 3const matchers = [ 'path/to/file.js', 'path/anyjs/**/*.js', /foo.js$/, string => string.includes('bar') && string.length > 10 ] ; 4 5anymatch(matchers, 'path/to/file.js'); // true 6anymatch(matchers, 'path/anyjs/baz.js'); // true 7anymatch(matchers, 'path/to/foo.js'); // true 8anymatch(matchers, 'path/to/bar.js'); // true 9anymatch(matchers, 'bar.js'); // false 10 11// returnIndex = true 12anymatch(matchers, 'foo.js', {returnIndex: true}); // 2 13anymatch(matchers, 'path/anyjs/foo.js', {returnIndex: true}); // 1 14 15// any picomatc 16 17// using globs to match directories and their children 18anymatch('node_modules', 'node_modules'); // true 19anymatch('node_modules', 'node_modules/somelib/index.js'); // false 20anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true 21anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false 22anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true 23 24const matcher = anymatch(matchers); 25['foo.js', 'bar.js'].filter(matcher); // [ 'foo.js' ] 26anymatch master* ❯ 27
You can also pass in only your matcher(s) to get a curried function that has
already been bound to the provided matching criteria. This can be used as an
Array#filter
callback.
1var matcher = anymatch(matchers); 2 3matcher('path/to/file.js'); // true 4matcher('path/anyjs/baz.js', true); // 1 5 6['foo.js', 'bar.js'].filter(matcher); // ['foo.js']
See release notes page on GitHub
startIndex
and endIndex
arguments. Node 8.x-only.No vulnerabilities found.
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 7/23 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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