npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@depup/micromatch

v1.0.0-depup.0

Published

Glob matching for javascript/node.js. A faster alternative to minimatch (10-20x faster on avg), with all the features you're used to using in your Grunt and gulp tasks.

Readme

micromatch NPM version

Glob matching for javascript/node.js. A faster and more stable alternative to minimatch (bencharks show micromatch is 10-40x faster on avg).

  • 10-20x faster than minimatch (benchmarks) on average
  • Focus on core Bash 4.3 specification features that are actually used (or can be used) in node.js
  • Supports passing glob patterns as a string or array
  • Extensive unit tests

Features

Supports

All the mainstream glob features you're used to using in your gulp and Grunt tasks:

  • Brace Expansion (foo/bar-{1..5}.md, one/{two,three}/four.md)
  • Globstar matching (**/*, a/b/*.js, etc)
  • Logical OR (foo/bar/(abc|xyz).js)
  • Regex character classes (foo/bar/baz-[1-5].js)

You can combine these features to achieve whatever matching patterns you need.

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 that are rarely used.

Install with npm

npm i micromatch --save

Usage

Works exactly the same as minimatch.

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']

Special characters

With the exception of brace expansion ({a,b}, {1..5}, etc), most of the special characters convert directly to regex, so you can expect them to follow the same rules and produce the same results as regex.

Square brackets

Given ['a.js', 'b.js', 'c.js', 'd.js', 'E.js']:

  • [ac].js: matches both a and c, returning ['a.js', 'c.js']
  • [b-d].js: matches from b to d, returning ['b.js', 'c.js', 'd.js']
  • [b-d].js: matches from b to d, returning ['b.js', 'c.js', 'd.js']
  • a/[A-Z].js: matches and uppercase letter, returning ['a/E.md']

Learn about regex character classes.

Parentheses

Given ['a.js', 'b.js', 'c.js', 'd.js', 'E.js']:

  • (a|c).js: would match either a or c, returning ['a.js', 'c.js']
  • (b|d).js: would match either b or d, returning ['b.js', 'd.js']
  • (b|[A-Z]).js: would match either b or an uppercase letter, returning ['b.js', 'E.js']

As with regex, parenthese can be nested, so patterns like ((a|b)|c)/b will work. But it might be easier to achieve your goal using brace expansion.

Brace Expansion

In simple cases, brace expansion appears to work the same way as the logical OR operator. For example, (a|b) will achieve the same result as {a,b}.

Here are some powerful features unique to brace expansion:

  • range expansion: a{1..3}b/*.js expands to: ['a1b/*.js', 'a2b/*.js', 'a3b/*.js']

Learn about brace expansion, or visit braces to ask questions and create an issue related to brace-expansion, or to see the full range of features and options related to brace expansion.

.matchRe

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

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 28, 2014.