micromatch
Glob matching for javascript/node.js. Like minimatch, but 10-40x faster.
- 5-40x faster than minimatch (benchmarks)
- Extensice unit tests, well-organized code-base
Features
Supports
All the mainstream glob features you're used to using in your gulp and Grunt tasks:
- Brace Expansion - ex.
foo/bar-{1..5}.md
, one/{two,three}/four.md
- Globstar matching - ex.
**/*
, a/b/*.js
Does not support
- Extended glob matching. This might be supported in the future, either in core or as an extension, but it's hard to justify the cost in terms of speed and complexity for features no that are rarely used.
Install with npm
npm i micromatch --save
Usage
var micromatch = require('micromatch');
mm(['a.js', 'b.md', 'c.txt'], '*.{js,txt}');
Also supports negation patterns:
mm(['a.js', 'b.md', 'c.txt'], '!*.{js,txt}');
mm(['a.md', 'b.js', 'c.txt', 'd.json'], ['*.*', '!*.{js,txt}']);
Benchmarks
Run the benchmarks
node benchmark/
Run tests
Install dev dependencies
npm i -d && mocha
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 23, 2014.