JSPM

  • Created
  • Published
  • Downloads 109956779
  • Score
    100M100P100Q238705F
  • License

Glob matching for javascript/node.js. Like minimatch, but 10-40x faster.

Package Exports

  • micromatch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (micromatch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

micromatch NPM version

Glob matching for javascript/node.js. Like minimatch, but 10-40x faster.

  • 5-40x faster than minimatch (benchmarks)
  • Focus on core Bash 4.3 specification features that are actually used (or can be used) in node.js
  • Extensive unit tests

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

micromatch()

var micromatch = require('micromatch');

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

Negation patterns:

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

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

micromatch.matchRe()

Generate a regular expression for matching file paths based on the given pattern:

var
micromatch.makeRe('a/?/c.md');
//=> /^a\/.\/c\.md$/

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

Please be sure to run the benchmarks before/after any code changes to judge the impact before you do a PR. thanks!

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on December 23, 2014.