Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

micromatch

0.2.0 • Public • Published

micromatch NPM version

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}');
//=> ['a.js', 'c.txt']

Also supports negation patterns:

mm(['a.js', 'b.md', 'c.txt'], '!*.{js,txt}');
//=> ['b.md']
 
mm(['a.md', 'b.js', 'c.txt', 'd.json'], ['*.*', '!*.{js,txt}']);
//=> ['a.md', 'd.json']

Benchmarks

Run the benchmarks

node benchmark/

image

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.

Install

npm i [email protected]

Version

0.2.0

License

MIT

Last publish

Collaborators

  • avatar
  • avatar
  • avatar