micromatch(list, pattern)
Filters a list of strings based on a glob pattern. Supports negation with a leading !.
Parameters:
list(string[]) – Array of strings to match.pattern(string) – Glob pattern.
Returns: Array of matched strings.
Example:
1const files = ["index.js", "style.css", "app.js"];2console.log(micromatch.micromatch(files, "*.js")); // ["index.js", "app.js"]3console.log(micromatch.micromatch(files, "!*.js")); // ["style.css"]