anymatch is a JavaScript module that matches a string against configurable matchers such as regular expressions, glob patterns, direct strings, or functions (or arrays mixing these). It is useful for flexible, user-defined configuration like matching file paths, and it can optionally return the index of the first matching matcher instead of just a boolean.
Project status
- Maintenance status: Evidence suggests low-activity maintenance mode, with the last upstream push dated 2023-05-18 and the most recent documented updates (v3.1.3) on 2022-11-21. No signs of frequent ongoing work near today (2026-06-09).
- Update cadence: Updates are infrequent over the last several years (for example, v3.1.3 in 2022, next earlier item v3.1.2 in 2021, then 2019, 2017, etc.), indicating a long gap between changes.
AI summary generated
Recent updates
v3.1.3
Release v3.1.3 (2022-11-21) includes two targeted fixes: preserving trailing separators in matched paths, and improving TypeScript typings for a null test string input. The code changes are small (+6/-2 across 4 files) and appear to implement exactly what the release notes describe.
3.1.2
Release 3.1.2 release notes only say “Bugfixes” and provide no specific details. The actual diff from 2.0.0 to 3.1.2 shows a major internal refactor of the anymatch implementation and a number of API and dependency changes that are not described in the release notes.
Features3.1.1
Release 3.1.1 was published on 2019-10-01, but no release notes were provided by the publisher. As a result, there is no documented information here about new functionality, bug fixes, security changes, or breaking behavior.
2.0.0
Release 2.0.0 bumps the micromatch dependency to the v3 major line and moves the package under the micromatch GitHub organization. The release notes only mention these two points, but the code and README indicate additional behavioral changes tied to micromatch v3 (notably backslash handling).
Breaking1.3.2
Release 1.3.2 fixes path handling when matching, specifically addressing issues with backslashes and compatibility with older environments. It also updates CI and documentation/examples to reflect matcher behavior more accurately.
1.3.0
Release 1.3.0 adds support for negated glob patterns (strings starting with '!') when matchers are provided as an array, including in curried usage. It also improves Windows path handling by normalizing backslashes to forward slashes for string equality checks and RegExp matching.
BreakingFeatures1.2.1
Release 1.2.1 is a small patch that fixes a bug in the curried form of anymatch when the matcher criteria includes a function. The code change adjusts how criteria are transformed when anymatch is called with a single argument (currying), and the test suite is expanded to cover returnIndex behavior for curried matchers.
1.2.0
Release 1.2.0 switches glob matching from minimatch to micromatch, and updates the implementation accordingly. The diff also introduces arrify and changes how the exported anymatch function handles its “curried” (single-argument) form.
1.1.0
Release 1.1.0 adds support for passing the test string as an array where the first element is treated as the testString. For function matchers specifically, any additional array elements are now forwarded as extra arguments to the matcher function.
Features1.0.0
Version 1.0.0 refactors the module to remove the separate `.matcher()` API and instead supports currying by calling the main `anymatch` function with only the matcher criteria. The implementation moved to a new root `index.js`, and the project build/test setup was modernized.
BreakingFeatures0.2.0
Release 0.2.0 adds support for optional `startIndex` and `endIndex` parameters to limit which matcher entries are evaluated by `anymatch`. The core matcher logic now subsets the matcher array before searching for the first match, and the README is updated with example usage.
Features