Socket
Socket
Sign inDemoInstall

micromatch

Package Overview
Dependencies
5
Maintainers
3
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.10 to 4.0.0

101

CHANGELOG.md

@@ -1,29 +0,101 @@

## History
# Release history
### key
All notable changes to this project will be documented in this file.
Changelog entries are classified using the following labels _(from [keep-a-changelog][]_):
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
- `added`: for new features
- `changed`: for changes in existing functionality
- `deprecated`: for once-stable features removed in upcoming releases
- `removed`: for deprecated features removed in this release
- `fixed`: for any bug fixes
- `bumped`: updated dependencies, only minor or higher will be listed.
<details>
<summary><strong>Guiding Principles</strong></summary>
### [3.0.0] - 2017-04-11
- Changelogs are for humans, not machines.
- There should be an entry for every single version.
- The same types of changes should be grouped.
- Versions and sections should be linkable.
- The latest version comes first.
- The release date of each versions is displayed.
- Mention whether you follow Semantic Versioning.
TODO. There should be no breaking changes. Please report any regressions. I will [reformat these release notes](https://github.com/micromatch/micromatch/pull/76) and add them to the changelog as soon as I have a chance.
</details>
### [1.0.1] - 2016-12-12
<details>
<summary><strong>Types of changes</strong></summary>
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.
</details>
## [4.0.0] - 2019-03-20
### Added
- Adds support for `options.onMatch`. See the readme for details
- Adds support for `options.onIgnore`. See the readme for details
- Adds support for `options.onResult`. See the readme for details
### Breaking changes
- Removed support for passing an array of brace patterns to `micromatch.braces()`.
- To strictly enforce closing brackets (for `{`, `[`, and `(`), you must now use `strictBrackets=true` instead of `strictErrors`.
- `cache` - caching and all related options and methods have been removed
- `options.unixify` was renamed to `options.windows`
- `options.nodupes` Was removed. Duplicates are always removed by default. You can override this with custom behavior by using the `onMatch`, `onResult` and `onIgnore` functions.
- `options.snapdragon` was removed, as snapdragon is no longer used.
- `options.sourcemap` was removed, as snapdragon is no longer used, which provided sourcemap support.
## [3.0.0] - 2017-04-11
Complete overhaul, with 36,000+ new unit tests validated against actual output generated by Bash and minimatch. More specifically, 35,000+ of the tests:
- micromatch results are directly compared to bash results
- in rare cases, when micromatch and bash disagree, micromatch's results are compared to minimatch's results
- micromatch is much more accurate than minimatch, so there were cases where I had to make assumptions. I'll try to document these.
This refactor introduces a parser and compiler that are supersets of more granular parsers and compilers from other sub-modules. Each of these sub-modules has a singular responsibility and focuses on a certain type of matching that aligns with a specific part of the Bash "expansion" API.
These sub-modules work like plugins to seamlessly create the micromatch parser/compiler, so that strings are parsed in one pass, an [AST is created](https://gist.github.com/jonschlinkert/099c8914f56529f75bc757cc9e5e8e2a), then a new string is generated by the compiler.
Here are those sub-modules with links to related prs on those modules if you want to see how they contribute to this code:
[nanomatch](https://github.com/jonschlinkert/nanomatch) (new library) - glob expansion (`*`, `**`, `?` and `[...]`))
[braces](https://github.com/jonschlinkert/braces/pull/10) - brace expansion (`{1..10}`, `{a,b,c}`, etc)
[extglob](https://github.com/jonschlinkert/extglob/pull/5) - extended globs (`!(a|b)`, `@(!(foo|bar))`, etc)
[expand-brackets](https://github.com/jonschlinkert/expand-brackets/pull/5) - POSIX character classes `[[:alpha:][:digit:]]`
**Added**
- source map support (optionally created when using parse or compile - I have no idea what the use case is yet, but they come for free) (note that source maps are not generated for brace expansion at present, since the braces compiler uses a different strategy. I'll update if/when this changes).
- parser is exposed, so that implementors can customize or override specific micromatch parsers if necessary
- compiler is exposed, so that implementors can customize or override specific micromatch compilers if necessary
**Fixed**
- more accurate matching (passes 100% of Bash 4.3 of the brace expansion and extglob unit tests, as well as all Bash glob tests that are relevant to node.js usage, all minimatch tests, all brace-expansion tests, and also passes a couple of tests that bash fails)
- even safer - micromatch has always generated optimized patterns so it's not subject to DoS exploits like minimatch (completely different than the regex DoS issue, minimatch and multimatch are still openly exposed to being used for DoS attacks), but more safeguards were built into this refactor
**Changed**
- the public API of this library did not change in this version and should be safe to upgrade without changing implentor code. However, we have released this as a major version for the following reasons:
- out of an abundance of caution due to the large amount of code changed in this release
- we have improved parser accuracy to such a degree that some implementors using invalid globs have noted change in behavior. If this is the case for you, please check that you are using a valid glob expression before logging a bug with this library
## [1.0.1] - 2016-12-12
**Added**
- Support for windows path edge cases where backslashes are used in brackets or other unusual combinations.
### [1.0.0] - 2016-12-12
## [1.0.0] - 2016-12-12
Stable release.
### [0.1.0] - 2016-10-08
## [0.1.0] - 2016-10-08

@@ -37,2 +109,1 @@ First release.

[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog

890

index.js
'use strict';
/**
* Module dependencies
*/
const util = require('util');
const braces = require('braces');
const picomatch = require('picomatch');
const utils = require('picomatch/lib/utils');
const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
var util = require('util');
var braces = require('braces');
var toRegex = require('to-regex');
var extend = require('extend-shallow');
/**
* Local dependencies
*/
var compilers = require('./lib/compilers');
var parsers = require('./lib/parsers');
var cache = require('./lib/cache');
var utils = require('./lib/utils');
var MAX_LENGTH = 1024 * 64;
/**
* The main function takes a list of strings and one or more
* glob patterns to use for matching.
* Returns an array of strings that match one or more glob patterns.
*
* ```js
* var mm = require('micromatch');
* mm(list, patterns[, options]);
* const mm = require('micromatch');
* // mm(list, patterns[, options]);
*

@@ -33,5 +19,5 @@ * console.log(mm(['a.js', 'a.txt'], ['*.js']));

* ```
* @param {Array} `list` A list of strings to match
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @param {String|Array<string>} list List of strings to match.
* @param {String|Array<string>} patterns One or more glob patterns to use for matching.
* @param {Object} options See available [options](#options)
* @return {Array} Returns an array of matches

@@ -42,149 +28,88 @@ * @summary false

function micromatch(list, patterns, options) {
patterns = utils.arrayify(patterns);
list = utils.arrayify(list);
const micromatch = (list, patterns, options) => {
patterns = [].concat(patterns);
list = [].concat(list);
var len = patterns.length;
if (list.length === 0 || len === 0) {
return [];
}
let omit = new Set();
let keep = new Set();
let items = new Set();
let negatives = 0;
if (len === 1) {
return micromatch.match(list, patterns[0], options);
}
var omit = [];
var keep = [];
var idx = -1;
while (++idx < len) {
var pattern = patterns[idx];
if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) {
omit.push.apply(omit, micromatch.match(list, pattern.slice(1), options));
} else {
keep.push.apply(keep, micromatch.match(list, pattern, options));
let onResult = state => {
items.add(state.output);
if (options && options.onResult) {
options.onResult(state);
}
}
};
var matches = utils.diff(keep, omit);
if (!options || options.nodupes !== false) {
return utils.unique(matches);
}
for (let i = 0; i < patterns.length; i++) {
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
if (negated) negatives++;
return matches;
}
for (let item of list) {
let matched = isMatch(item, true);
/**
* Similar to the main function, but `pattern` must be a string.
*
* ```js
* var mm = require('micromatch');
* mm.match(list, pattern[, options]);
*
* console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a'));
* //=> ['a.a', 'a.aa']
* ```
* @param {Array} `list` Array of strings to match
* @param {String} `pattern` Glob pattern to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Array} Returns an array of matches
* @api public
*/
let match = negated ? !matched.isMatch : matched.isMatch;
if (!match) continue;
micromatch.match = function(list, pattern, options) {
if (Array.isArray(pattern)) {
throw new TypeError('expected pattern to be a string');
}
var unixify = utils.unixify(options);
var isMatch = memoize('match', pattern, options, micromatch.matcher);
var matches = [];
list = utils.arrayify(list);
var len = list.length;
var idx = -1;
while (++idx < len) {
var ele = list[idx];
if (ele === pattern || isMatch(ele)) {
matches.push(utils.value(ele, unixify, options));
if (negated) {
omit.add(matched.output);
} else {
omit.delete(matched.output);
keep.add(matched.output);
}
}
}
// if no options were passed, uniquify results and return
if (typeof options === 'undefined') {
return utils.unique(matches);
}
let result = negatives === patterns.length ? [...items] : [...keep];
let matches = result.filter(item => !omit.has(item));
if (matches.length === 0) {
if (options && matches.length === 0) {
if (options.failglob === true) {
throw new Error('no matches found for "' + pattern + '"');
throw new Error(`No matches found for "${patterns.join(', ')}"`);
}
if (options.nonull === true || options.nullglob === true) {
return [options.unescape ? utils.unescape(pattern) : pattern];
return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
}
}
// if `opts.ignore` was defined, diff ignored list
if (options.ignore) {
matches = micromatch.not(matches, options.ignore, options);
}
return options.nodupes !== false ? utils.unique(matches) : matches;
return matches;
};
/**
* Returns true if the specified `string` matches the given glob `pattern`.
* Returns a matcher function from the given glob `pattern` and `options`.
* The returned function takes a string to match as its only argument and returns
* true if the string is a match.
*
* ```js
* var mm = require('micromatch');
* mm.isMatch(string, pattern[, options]);
* const mm = require('micromatch');
* // mm.matcher(pattern[, options]);
*
* console.log(mm.isMatch('a.a', '*.a'));
* //=> true
* console.log(mm.isMatch('a.b', '*.a'));
* //=> false
* const isMatch = mm.matcher('*.!(*a)');
* console.log(isMatch('a.a')); //=> false
* console.log(isMatch('a.b')); //=> true
* ```
* @param {String} `string` String to match
* @param {String} `pattern` Glob pattern to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if the string matches the glob pattern.
* @param {String} `pattern` Glob pattern
* @param {Object} `options`
* @return {Function} Returns a matcher function.
* @api public
*/
micromatch.isMatch = function(str, pattern, options) {
if (typeof str !== 'string') {
throw new TypeError('expected a string: "' + util.inspect(str) + '"');
}
micromatch.matcher = (pattern, options) => picomatch(pattern, options);
if (isEmptyString(str) || isEmptyString(pattern)) {
return false;
}
var equals = utils.equalsPattern(options);
if (equals(str)) {
return true;
}
var isMatch = memoize('isMatch', pattern, options, micromatch.matcher);
return isMatch(str);
};
/**
* Returns true if some of the strings in the given `list` match any of the
* given glob `patterns`.
* Returns true if **any** of the given glob `patterns` match the specified `string`.
*
* ```js
* var mm = require('micromatch');
* mm.some(list, patterns[, options]);
* const mm = require('micromatch');
* // mm.isMatch(string, patterns[, options]);
*
* console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
* // true
* console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
* // false
* console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
* console.log(mm.isMatch('a.a', 'b.*')); //=> false
* ```
* @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @param {String} str The string to test.
* @param {String|Array} patterns One or more glob patterns to use for matching.
* @param {Object} [options] See available [options](#options).
* @return {Boolean} Returns true if any patterns match `str`

@@ -194,139 +119,10 @@ * @api public

micromatch.some = function(list, patterns, options) {
if (typeof list === 'string') {
list = [list];
}
for (var i = 0; i < list.length; i++) {
if (micromatch(list[i], patterns, options).length === 1) {
return true;
}
}
return false;
};
micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
/**
* Returns true if every string in the given `list` matches
* any of the given glob `patterns`.
*
* ```js
* var mm = require('micromatch');
* mm.every(list, patterns[, options]);
*
* console.log(mm.every('foo.js', ['foo.js']));
* // true
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
* // true
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
* // false
* console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
* // false
* ```
* @param {String|Array} `list` The string or array of strings to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.every = function(list, patterns, options) {
if (typeof list === 'string') {
list = [list];
}
for (var i = 0; i < list.length; i++) {
if (micromatch(list[i], patterns, options).length !== 1) {
return false;
}
}
return true;
};
/**
* Returns true if **any** of the given glob `patterns`
* match the specified `string`.
*
* ```js
* var mm = require('micromatch');
* mm.any(string, patterns[, options]);
*
* console.log(mm.any('a.a', ['b.*', '*.a']));
* //=> true
* console.log(mm.any('a.a', 'b.*'));
* //=> false
* ```
* @param {String|Array} `str` The string to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.any = function(str, patterns, options) {
if (typeof str !== 'string') {
throw new TypeError('expected a string: "' + util.inspect(str) + '"');
}
if (isEmptyString(str) || isEmptyString(patterns)) {
return false;
}
if (typeof patterns === 'string') {
patterns = [patterns];
}
for (var i = 0; i < patterns.length; i++) {
if (micromatch.isMatch(str, patterns[i], options)) {
return true;
}
}
return false;
};
/**
* Returns true if **all** of the given `patterns` match
* the specified string.
*
* ```js
* var mm = require('micromatch');
* mm.all(string, patterns[, options]);
*
* console.log(mm.all('foo.js', ['foo.js']));
* // true
*
* console.log(mm.all('foo.js', ['*.js', '!foo.js']));
* // false
*
* console.log(mm.all('foo.js', ['*.js', 'foo.js']));
* // true
*
* console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
* // true
* ```
* @param {String|Array} `str` The string to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.all = function(str, patterns, options) {
if (typeof str !== 'string') {
throw new TypeError('expected a string: "' + util.inspect(str) + '"');
}
if (typeof patterns === 'string') {
patterns = [patterns];
}
for (var i = 0; i < patterns.length; i++) {
if (!micromatch.isMatch(str, patterns[i], options)) {
return false;
}
}
return true;
};
/**
* Returns a list of strings that _**do not match any**_ of the given `patterns`.
*
* ```js
* var mm = require('micromatch');
* mm.not(list, patterns[, options]);
* const mm = require('micromatch');
* // mm.not(list, patterns[, options]);
*

@@ -343,16 +139,20 @@ * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));

micromatch.not = function(list, patterns, options) {
var opts = extend({}, options);
var ignore = opts.ignore;
delete opts.ignore;
micromatch.not = (list, patterns, options = {}) => {
patterns = [].concat(patterns).map(String);
let result = new Set();
let items = [];
var unixify = utils.unixify(opts);
list = utils.arrayify(list).map(unixify);
let onResult = state => {
if (options.onResult) options.onResult(state);
items.push(state.output);
};
var matches = utils.diff(list, micromatch(list, patterns, opts));
if (ignore) {
matches = utils.diff(matches, micromatch(list, ignore));
let matches = micromatch(list, patterns, { ...options, onResult });
for (let item of items) {
if (!matches.includes(item)) {
result.add(item);
}
}
return opts.nodupes !== false ? utils.unique(matches) : matches;
return [...result];
};

@@ -366,3 +166,3 @@

* var mm = require('micromatch');
* mm.contains(string, pattern[, options]);
* // mm.contains(string, pattern[, options]);
*

@@ -381,39 +181,25 @@ * console.log(mm.contains('aa/bb/cc', '*b'));

micromatch.contains = function(str, patterns, options) {
micromatch.contains = (str, pattern, options) => {
if (typeof str !== 'string') {
throw new TypeError('expected a string: "' + util.inspect(str) + '"');
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
}
if (typeof patterns === 'string') {
if (isEmptyString(str) || isEmptyString(patterns)) {
if (Array.isArray(pattern)) {
return pattern.some(p => micromatch.contains(str, p, options));
}
if (typeof pattern === 'string') {
if (isEmptyString(str) || isEmptyString(pattern)) {
return false;
}
var equals = utils.equalsPattern(patterns, options);
if (equals(str)) {
if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) {
return true;
}
var contains = utils.containsPattern(patterns, options);
if (contains(str)) {
return true;
}
}
var opts = extend({}, options, {contains: true});
return micromatch.any(str, patterns, opts);
return micromatch.isMatch(str, pattern, { ...options, contains: true });
};
/**
* Returns true if the given pattern and options should enable
* the `matchBase` option.
* @return {Boolean}
* @api private
*/
micromatch.matchBase = function(pattern, options) {
if (pattern && pattern.indexOf('/') !== -1 || !options) return false;
return options.basename === true || options.matchBase === true;
};
/**
* Filter the keys of the given object with the given `glob` pattern

@@ -424,6 +210,6 @@ * and `options`. Does not attempt to match nested keys. If you need this feature,

* ```js
* var mm = require('micromatch');
* mm.matchKeys(object, patterns[, options]);
* const mm = require('micromatch');
* // mm.matchKeys(object, patterns[, options]);
*
* var obj = { aa: 'a', ab: 'b', ac: 'c' };
* const obj = { aa: 'a', ab: 'b', ac: 'c' };
* console.log(mm.matchKeys(obj, '*b'));

@@ -439,447 +225,239 @@ * //=> { ab: 'b' }

micromatch.matchKeys = function(obj, patterns, options) {
micromatch.matchKeys = (obj, patterns, options) => {
if (!utils.isObject(obj)) {
throw new TypeError('expected the first argument to be an object');
throw new TypeError('Expected the first argument to be an object');
}
var keys = micromatch(Object.keys(obj), patterns, options);
return utils.pick(obj, keys);
let keys = micromatch(Object.keys(obj), patterns, options);
let res = {};
for (let key of keys) res[key] = obj[key];
return res;
};
/**
* Returns a memoized matcher function from the given glob `pattern` and `options`.
* The returned function takes a string to match as its only argument and returns
* true if the string is a match.
* Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
*
* ```js
* var mm = require('micromatch');
* mm.matcher(pattern[, options]);
* const mm = require('micromatch');
* // mm.some(list, patterns[, options]);
*
* var isMatch = mm.matcher('*.!(*a)');
* console.log(isMatch('a.a'));
* //=> false
* console.log(isMatch('a.b'));
* //=> true
* console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
* // true
* console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
* // false
* ```
* @param {String} `pattern` Glob pattern
* @param {Object} `options` See available [options](#options) for changing how matches are performed.
* @return {Function} Returns a matcher function.
* @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.matcher = function matcher(pattern, options) {
if (Array.isArray(pattern)) {
return compose(pattern, options, matcher);
}
micromatch.some = (list, patterns, options) => {
let items = [].concat(list);
// if pattern is a regex
if (pattern instanceof RegExp) {
return test(pattern);
}
// if pattern is invalid
if (!utils.isString(pattern)) {
throw new TypeError('expected pattern to be an array, string or regex');
}
// if pattern is a non-glob string
if (!utils.hasSpecialChars(pattern)) {
if (options && options.nocase === true) {
pattern = pattern.toLowerCase();
for (let pattern of [].concat(patterns)) {
let isMatch = picomatch(String(pattern), options);
if (items.some(item => isMatch(item))) {
return true;
}
return utils.matchPath(pattern, options);
}
// if pattern is a glob string
var re = micromatch.makeRe(pattern, options);
// if `options.matchBase` or `options.basename` is defined
if (micromatch.matchBase(pattern, options)) {
return utils.matchBasename(re, options);
}
function test(regex) {
var equals = utils.equalsPattern(options);
var unixify = utils.unixify(options);
return function(str) {
if (equals(str)) {
return true;
}
if (regex.test(unixify(str))) {
return true;
}
return false;
};
}
var fn = test(re);
Object.defineProperty(fn, 'result', {
configurable: true,
enumerable: false,
value: re.result
});
return fn;
return false;
};
/**
* Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
* Returns true if every string in the given `list` matches
* any of the given glob `patterns`.
*
* ```js
* var mm = require('micromatch');
* mm.capture(pattern, string[, options]);
* const mm = require('micromatch');
* // mm.every(list, patterns[, options]);
*
* console.log(mm.capture('test/*.js', 'test/foo.js'));
* //=> ['foo']
* console.log(mm.capture('test/*.js', 'foo/bar.css'));
* //=> null
* console.log(mm.every('foo.js', ['foo.js']));
* // true
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
* // true
* console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
* // false
* console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
* // false
* ```
* @param {String} `pattern` Glob pattern to use for matching.
* @param {String} `string` String to match
* @param {String|Array} `list` The string or array of strings to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`.
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.capture = function(pattern, str, options) {
var re = micromatch.makeRe(pattern, extend({capture: true}, options));
var unixify = utils.unixify(options);
micromatch.every = (list, patterns, options) => {
let items = [].concat(list);
function match() {
return function(string) {
var match = re.exec(unixify(string));
if (!match) {
return null;
}
return match.slice(1);
};
for (let pattern of [].concat(patterns)) {
let isMatch = picomatch(String(pattern), options);
if (!items.every(item => isMatch(item))) {
return false;
}
}
var capture = memoize('capture', pattern, options, match);
return capture(str);
return true;
};
/**
* Create a regular expression from the given glob `pattern`.
* Returns true if **all** of the given `patterns` match
* the specified string.
*
* ```js
* var mm = require('micromatch');
* mm.makeRe(pattern[, options]);
* const mm = require('micromatch');
* // mm.all(string, patterns[, options]);
*
* console.log(mm.makeRe('*.js'));
* //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
* console.log(mm.all('foo.js', ['foo.js']));
* // true
*
* console.log(mm.all('foo.js', ['*.js', '!foo.js']));
* // false
*
* console.log(mm.all('foo.js', ['*.js', 'foo.js']));
* // true
*
* console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
* // true
* ```
* @param {String} `pattern` A glob pattern to convert to regex.
* @param {Object} `options` See available [options](#options) for changing how matches are performed.
* @return {RegExp} Returns a regex created from the given pattern.
* @param {String|Array} `str` The string to test.
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
micromatch.makeRe = function(pattern, options) {
if (typeof pattern !== 'string') {
throw new TypeError('expected pattern to be a string');
micromatch.all = (str, patterns, options) => {
if (typeof str !== 'string') {
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
}
if (pattern.length > MAX_LENGTH) {
throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
}
function makeRe() {
var result = micromatch.create(pattern, options);
var ast_array = [];
var output = result.map(function(obj) {
obj.ast.state = obj.state;
ast_array.push(obj.ast);
return obj.output;
});
var regex = toRegex(output.join('|'), options);
Object.defineProperty(regex, 'result', {
configurable: true,
enumerable: false,
value: ast_array
});
return regex;
}
return memoize('makeRe', pattern, options, makeRe);
return [].concat(patterns).every(p => picomatch(p, options)(str));
};
/**
* Expand the given brace `pattern`.
* Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
*
* ```js
* var mm = require('micromatch');
* console.log(mm.braces('foo/{a,b}/bar'));
* //=> ['foo/(a|b)/bar']
* const mm = require('micromatch');
* // mm.capture(pattern, string[, options]);
*
* console.log(mm.braces('foo/{a,b}/bar', {expand: true}));
* //=> ['foo/(a|b)/bar']
* console.log(mm.capture('test/*.js', 'test/foo.js'));
* //=> ['foo']
* console.log(mm.capture('test/*.js', 'foo/bar.css'));
* //=> null
* ```
* @param {String} `pattern` String with brace pattern to expand.
* @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
* @return {Array}
* @param {String} `glob` Glob pattern to use for matching.
* @param {String} `input` String to match
* @param {Object} `options` See available [options](#options) for changing how matches are performed
* @return {Boolean} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
* @api public
*/
micromatch.braces = function(pattern, options) {
if (typeof pattern !== 'string' && !Array.isArray(pattern)) {
throw new TypeError('expected pattern to be an array or string');
}
micromatch.capture = (glob, input, options) => {
let posix = utils.isWindows(options);
let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
function expand() {
if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
return utils.arrayify(pattern);
}
return braces(pattern, options);
if (match) {
return match.slice(1).map(v => v === void 0 ? '' : v);
}
return memoize('braces', pattern, options, expand);
};
/**
* Proxy to the [micromatch.braces](#method), for parity with
* minimatch.
*/
micromatch.braceExpand = function(pattern, options) {
var opts = extend({}, options, {expand: true});
return micromatch.braces(pattern, opts);
};
/**
* Parses the given glob `pattern` and returns an array of abstract syntax
* trees (ASTs), with the compiled `output` and optional source `map` on
* each AST.
* Create a regular expression from the given glob `pattern`.
*
* ```js
* var mm = require('micromatch');
* mm.create(pattern[, options]);
* const mm = require('micromatch');
* // mm.makeRe(pattern[, options]);
*
* console.log(mm.create('abc/*.js'));
* // [{ options: { source: 'string', sourcemap: true },
* // state: {},
* // compilers:
* // { ... },
* // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js',
* // ast:
* // { type: 'root',
* // errors: [],
* // nodes:
* // [ ... ],
* // dot: false,
* // input: 'abc/*.js' },
* // parsingErrors: [],
* // map:
* // { version: 3,
* // sources: [ 'string' ],
* // names: [],
* // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE',
* // sourcesContent: [ 'abc/*.js' ] },
* // position: { line: 1, column: 28 },
* // content: {},
* // files: {},
* // idx: 6 }]
* console.log(mm.makeRe('*.js'));
* //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
* ```
* @param {String} `pattern` Glob pattern to parse and compile.
* @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed.
* @return {Object} Returns an object with the parsed AST, compiled string and optional source map.
* @param {String} `pattern` A glob pattern to convert to regex.
* @param {Object} `options`
* @return {RegExp} Returns a regex created from the given pattern.
* @api public
*/
micromatch.create = function(pattern, options) {
return memoize('create', pattern, options, function() {
function create(str, opts) {
return micromatch.compile(micromatch.parse(str, opts), opts);
}
micromatch.makeRe = (...args) => picomatch.makeRe(...args);
pattern = micromatch.braces(pattern, options);
var len = pattern.length;
var idx = -1;
var res = [];
while (++idx < len) {
res.push(create(pattern[idx], options));
}
return res;
});
};
/**
* Parse the given `str` with the given `options`.
* Scan a glob pattern to separate the pattern into segments. Used
* by the [split](#split) method.
*
* ```js
* var mm = require('micromatch');
* mm.parse(pattern[, options]);
*
* var ast = mm.parse('a/{b,c}/d');
* console.log(ast);
* // { type: 'root',
* // errors: [],
* // input: 'a/{b,c}/d',
* // nodes:
* // [ { type: 'bos', val: '' },
* // { type: 'text', val: 'a/' },
* // { type: 'brace',
* // nodes:
* // [ { type: 'brace.open', val: '{' },
* // { type: 'text', val: 'b,c' },
* // { type: 'brace.close', val: '}' } ] },
* // { type: 'text', val: '/d' },
* // { type: 'eos', val: '' } ] }
* const mm = require('micromatch');
* const state = mm.scan(pattern[, options]);
* ```
* @param {String} `str`
* @param {String} `pattern`
* @param {Object} `options`
* @return {Object} Returns an AST
* @return {Object} Returns an object with
* @api public
*/
micromatch.parse = function(pattern, options) {
if (typeof pattern !== 'string') {
throw new TypeError('expected a string');
}
micromatch.scan = (...args) => picomatch.scan(...args);
function parse() {
var snapdragon = utils.instantiate(null, options);
parsers(snapdragon, options);
var ast = snapdragon.parse(pattern, options);
utils.define(ast, 'snapdragon', snapdragon);
ast.input = pattern;
return ast;
}
return memoize('parse', pattern, options, parse);
};
/**
* Compile the given `ast` or string with the given `options`.
* Parse a glob pattern to create the source string for a regular
* expression.
*
* ```js
* var mm = require('micromatch');
* mm.compile(ast[, options]);
*
* var ast = mm.parse('a/{b,c}/d');
* console.log(mm.compile(ast));
* // { options: { source: 'string' },
* // state: {},
* // compilers:
* // { eos: [Function],
* // noop: [Function],
* // bos: [Function],
* // brace: [Function],
* // 'brace.open': [Function],
* // text: [Function],
* // 'brace.close': [Function] },
* // output: [ 'a/(b|c)/d' ],
* // ast:
* // { ... },
* // parsingErrors: [] }
* const mm = require('micromatch');
* const state = mm(pattern[, options]);
* ```
* @param {Object|String} `ast`
* @param {String} `glob`
* @param {Object} `options`
* @return {Object} Returns an object that has an `output` property with the compiled string.
* @return {Object} Returns an object with useful properties and output to be used as regex source string.
* @api public
*/
micromatch.compile = function(ast, options) {
if (typeof ast === 'string') {
ast = micromatch.parse(ast, options);
micromatch.parse = (patterns, options) => {
let res = [];
for (let pattern of [].concat(patterns || [])) {
for (let str of braces(String(pattern), options)) {
res.push(picomatch.parse(str, options));
}
}
return memoize('compile', ast.input, options, function() {
var snapdragon = utils.instantiate(ast, options);
compilers(snapdragon, options);
return snapdragon.compile(ast, options);
});
return res;
};
/**
* Clear the regex cache.
* Process the given brace `pattern`.
*
* ```js
* mm.clearCache();
* const { braces } = require('micromatch');
* console.log(braces('foo/{a,b,c}/bar'));
* //=> [ 'foo/(a|b|c)/bar' ]
*
* console.log(braces('foo/{a,b,c}/bar', { expand: true }));
* //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
* ```
* @param {String} `pattern` String with brace pattern to process.
* @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
* @return {Array}
* @api public
*/
micromatch.clearCache = function() {
micromatch.cache.caches = {};
micromatch.braces = (pattern, options) => {
if (typeof pattern !== 'string') throw new TypeError('Expected a string');
if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
return [pattern];
}
return braces(pattern, options);
};
/**
* Returns true if the given value is effectively an empty string
* Expand braces
*/
function isEmptyString(val) {
return String(val) === '' || String(val) === './';
}
micromatch.braceExpand = (pattern, options) => {
if (typeof pattern !== 'string') throw new TypeError('Expected a string');
return micromatch.braces(pattern, { ...options, expand: true });
};
/**
* Compose a matcher function with the given patterns.
* This allows matcher functions to be compiled once and
* called multiple times.
* Expose micromatch
*/
function compose(patterns, options, matcher) {
var matchers;
return memoize('compose', String(patterns), options, function() {
return function(file) {
// delay composition until it's invoked the first time,
// after that it won't be called again
if (!matchers) {
matchers = [];
for (var i = 0; i < patterns.length; i++) {
matchers.push(matcher(patterns[i], options));
}
}
var len = matchers.length;
while (len--) {
if (matchers[len](file) === true) {
return true;
}
}
return false;
};
});
}
/**
* Memoize a generated regex or function. A unique key is generated
* from the `type` (usually method name), the `pattern`, and
* user-defined options.
*/
function memoize(type, pattern, options, fn) {
var key = utils.createKey(type + '=' + pattern, options);
if (options && options.cache === false) {
return fn(pattern, options);
}
if (cache.has(type, key)) {
return cache.get(type, key);
}
var val = fn(pattern, options);
cache.set(type, key, val);
return val;
}
/**
* Expose compiler, parser and cache on `micromatch`
*/
micromatch.compilers = compilers;
micromatch.parsers = parsers;
micromatch.caches = cache.caches;
/**
* Expose `micromatch`
* @type {Function}
*/
module.exports = micromatch;
{
"name": "micromatch",
"description": "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.",
"version": "3.1.10",
"description": "Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.",
"version": "4.0.0",
"homepage": "https://github.com/micromatch/micromatch",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"(https://github.com/DianeLooney)",
"Amila Welihinda (amilajack.com)",

@@ -19,4 +20,3 @@ "Bogdan Chadkin (https://github.com/TrySound)",

"Tom Byrer (https://github.com/tomByrer)",
"Tyler Akins (http://rumkin.com)",
"(https://github.com/DianeLooney)"
"Tyler Akins (http://rumkin.com)"
],

@@ -29,8 +29,7 @@ "repository": "micromatch/micromatch",

"files": [
"index.js",
"lib"
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
"node": ">=8"
},

@@ -41,35 +40,21 @@ "scripts": {

"dependencies": {
"arr-diff": "^4.0.0",
"array-unique": "^0.3.2",
"braces": "^2.3.1",
"define-property": "^2.0.2",
"extend-shallow": "^3.0.2",
"extglob": "^2.0.4",
"fragment-cache": "^0.2.1",
"kind-of": "^6.0.2",
"nanomatch": "^1.2.9",
"object.pick": "^1.3.0",
"regex-not": "^1.0.0",
"snapdragon": "^0.8.1",
"to-regex": "^3.0.2"
"braces": "^3.0.1",
"picomatch": "^2.0.3"
},
"devDependencies": {
"bash-match": "^1.0.2",
"for-own": "^1.0.0",
"gulp": "^3.9.1",
"gulp-format-md": "^1.0.0",
"gulp-istanbul": "^1.1.3",
"gulp-mocha": "^5.0.0",
"gulp-unused": "^0.2.1",
"is-windows": "^1.0.2",
"fill-range": "^7.0.1",
"gulp-format-md": "^2.0.0",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"mocha": "^3.5.3",
"multimatch": "^2.1.0"
"mocha": "^5.2.0",
"time-require": "github:jonschlinkert/time-require"
},
"keywords": [
"bash",
"bracket",
"character-class",
"expand",
"expansion",
"expression",
"extglob",
"extglobs",
"file",

@@ -83,2 +68,5 @@ "files",

"globstar",
"lookahead",
"lookaround",
"lookbehind",
"match",

@@ -91,5 +79,8 @@ "matcher",

"multimatch",
"negate",
"negation",
"path",
"pattern",
"patterns",
"posix",
"regex",

@@ -99,22 +90,5 @@ "regexp",

"shell",
"star",
"wildcard"
],
"lintDeps": {
"dependencies": {
"options": {
"lock": {
"snapdragon": "^0.8.1"
}
}
},
"devDependencies": {
"files": {
"options": {
"ignore": [
"benchmark/**"
]
}
}
}
},
"verb": {

@@ -129,5 +103,5 @@ "toc": "collapsible",

],
"helpers": [
"./benchmark/helper.js"
],
"lint": {
"reflinks": true
},
"related": {

@@ -142,14 +116,10 @@ "list": [

},
"lint": {
"reflinks": true
},
"reflinks": [
"expand-brackets",
"extglob",
"fill-range",
"glob-object",
"minimatch",
"multimatch",
"snapdragon"
"multimatch"
]
}
}

@@ -1,4 +0,4 @@

# micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/micromatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/micromatch) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/micromatch.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/micromatch)
# micromatch [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/micromatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/micromatch)
> Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.
> Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.

@@ -21,13 +21,10 @@ Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.

- [Options](#options)
- [Options Examples](#options-examples)
* [options.basename](#optionsbasename)
* [options.bash](#optionsbash)
* [options.cache](#optionscache)
* [options.dot](#optionsdot)
* [options.failglob](#optionsfailglob)
* [options.expandRange](#optionsexpandrange)
* [options.format](#optionsformat)
* [options.ignore](#optionsignore)
* [options.matchBase](#optionsmatchbase)
* [options.nobrace](#optionsnobrace)
* [options.nocase](#optionsnocase)
* [options.nodupes](#optionsnodupes)
* [options.noext](#optionsnoext)
* [options.noextglob](#optionsnoextglob)
* [options.nonegate](#optionsnonegate)

@@ -37,11 +34,12 @@ * [options.noglobstar](#optionsnoglobstar)

* [options.nullglob](#optionsnullglob)
* [options.snapdragon](#optionssnapdragon)
* [options.sourcemap](#optionssourcemap)
* [options.onIgnore](#optionsonignore)
* [options.onMatch](#optionsonmatch)
* [options.onResult](#optionsonresult)
* [options.posixSlashes](#optionsposixslashes)
* [options.unescape](#optionsunescape)
* [options.unixify](#optionsunixify)
- [Extended globbing](#extended-globbing)
* [extglobs](#extglobs)
* [braces](#braces)
* [regex character classes](#regex-character-classes)
* [regex groups](#regex-groups)
* [Extglobs](#extglobs)
* [Braces](#braces)
* [Regex character classes](#regex-character-classes)
* [Regex groups](#regex-groups)
* [POSIX bracket expressions](#posix-bracket-expressions)

@@ -51,6 +49,6 @@ - [Notes](#notes)

* [Backslashes](#backslashes)
- [Contributing](#contributing)
- [Benchmarks](#benchmarks)
* [Running benchmarks](#running-benchmarks)
* [Latest results](#latest-results)
- [Contributing](#contributing)
- [About](#about)

@@ -71,4 +69,4 @@

```js
var mm = require('micromatch');
mm(list, patterns[, options]);
const micromatch = require('micromatch');
// micromatch(list, patterns[, options]);
```

@@ -79,11 +77,11 @@

```js
console.log(mm(['foo', 'bar', 'qux'], ['f*', 'b*']));
//=> ['foo', 'bar']
console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['f*', 'b*'])) //=> ['foo', 'bar', 'baz']
console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['*', '!b*'])) //=> ['foo', 'qux']
```
Use [.isMatch()](#ismatch) to get true/false:
Use [.isMatch()](#ismatch) to for boolean matching:
```js
console.log(mm.isMatch('foo', 'f*'));
//=> true
console.log(micromatch.isMatch('foo', 'f*')) //=> true
console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
```

@@ -93,13 +91,17 @@

<br>
## Why use micromatch?
> micromatch is a [drop-in replacement](#switching-to-micromatch) for minimatch and multimatch
> micromatch is a [replacement](#switching-to-micromatch) for minimatch and multimatch
* Supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch)
* Micromatch uses [snapdragon](https://github.com/jonschlinkert/snapdragon) for parsing and compiling globs, which provides granular control over the entire conversion process in a way that is easy to understand, reason about, and maintain.
* More consistently accurate matching [than minimatch](https://github.com/yarnpkg/yarn/pull/3339), with more than 36,000 [test assertions](./test) to prove it.
* More complete support for the Bash 4.3 specification than minimatch and multimatch. In fact, micromatch passes _all of the spec tests_ from bash, including some that bash still fails.
* [Faster matching](#benchmarks), from a combination of optimized glob patterns, faster algorithms, and regex caching.
* [Micromatch is safer](https://github.com/micromatch/braces#braces-is-safe), and is not subject to DoS with brace patterns, like minimatch and multimatch.
* More reliable windows support than minimatch and multimatch.
* More complete support for the Bash 4.3 specification than minimatch and multimatch. Micromatch passes _all of the spec tests_ from bash, including some that bash still fails.
* **Fast & Performant** - Loads in about 5ms and performs [fast matches](#benchmarks).
* **Glob matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories
* **[Advanced globbing](#advanced-globbing)** - Supports [extglobs](#extglobs), [braces](#braces), and [POSIX brackets](#posix-bracket-expressions), and support for escaping special characters with `\` or quotes.
* **Accurate** - Covers more scenarios [than minimatch](https://github.com/yarnpkg/yarn/pull/3339)
* **Well tested** - More than 5,000 [test assertions](./test)
* **Windows support** - More reliable windows support than minimatch and multimatch.
* **[Safe](https://github.com/micromatch/braces#braces-is-safe)** - Micromatch is not subject to DoS with brace patterns like minimatch and multimatch.

@@ -111,4 +113,4 @@ ### Matching features

* Negation (`'!a/*.js'`, `'*!(b).js']`)
* [extglobs](https://github.com/micromatch/extglob) (`+(x|y)`, `!(a|b)`)
* [POSIX character classes](https://github.com/micromatch/expand-brackets) (`[[:alpha:][:digit:]]`)
* [extglobs](#extglobs) (`+(x|y)`, `!(a|b)`)
* [POSIX character classes](#posix-bracket-expressions) (`[[:alpha:][:digit:]]`)
* [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`)

@@ -122,18 +124,16 @@ * regex character classes (`foo-[1-5].js`)

There is one notable difference between micromatch and minimatch in regards to how backslashes are handled. See [the notes about backslashes](#backslashes) for more information.
_(There is one notable difference between micromatch and minimatch in regards to how backslashes are handled. See [the notes about backslashes](#backslashes) for more information.)_
### From minimatch
Use [mm.isMatch()](#ismatch) instead of `minimatch()`:
Use [micromatch.isMatch()](#ismatch) instead of `minimatch()`:
```js
mm.isMatch('foo', 'b*');
//=> false
console.log(micromatch.isMatch('foo', 'b*')); //=> false
```
Use [mm.match()](#match) instead of `minimatch.match()`:
Use [micromatch.match()](#match) instead of `minimatch.match()`:
```js
mm.match(['foo', 'bar'], 'b*');
//=> 'bar'
console.log(micromatch.match(['foo', 'bar'], 'b*')); //=> 'bar'
```

@@ -146,4 +146,3 @@

```js
mm(['foo', 'bar', 'baz'], ['f*', '*z']);
//=> ['foo', 'baz']
console.log(micromatch(['foo', 'bar', 'baz'], ['f*', '*z'])); //=> ['foo', 'baz']
```

@@ -153,11 +152,7 @@

### [micromatch](index.js#L41)
The main function takes a list of strings and one or more glob patterns to use for matching.
**Params**
* `list` **{Array}**: A list of strings to match
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* **{String|Array<string>}**: list List of strings to match.
* **{String|Array<string>}**: patterns One or more glob patterns to use for matching.
* **{Object}**: options See available [options](#options)
* `returns` **{Array}**: Returns an array of matches

@@ -168,4 +163,4 @@

```js
var mm = require('micromatch');
mm(list, patterns[, options]);
const mm = require('micromatch');
// mm(list, patterns[, options]);

@@ -176,12 +171,11 @@ console.log(mm(['a.js', 'a.txt'], ['*.js']));

### [.match](index.js#L93)
### [.matcher](index.js#L98)
Similar to the main function, but `pattern` must be a string.
Returns a matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match.
**Params**
* `list` **{Array}**: Array of strings to match
* `pattern` **{String}**: Glob pattern to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Array}**: Returns an array of matches
* `pattern` **{String}**: Glob pattern
* `options` **{Object}**
* `returns` **{Function}**: Returns a matcher function.

@@ -191,19 +185,20 @@ **Example**

```js
var mm = require('micromatch');
mm.match(list, pattern[, options]);
const mm = require('micromatch');
// mm.matcher(pattern[, options]);
console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a'));
//=> ['a.a', 'a.aa']
const isMatch = mm.matcher('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
### [.isMatch](index.js#L154)
### [.isMatch](index.js#L117)
Returns true if the specified `string` matches the given glob `pattern`.
Returns true if **any** of the given glob `patterns` match the specified `string`.
**Params**
* `string` **{String}**: String to match
* `pattern` **{String}**: Glob pattern to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Boolean}**: Returns true if the string matches the glob pattern.
* **{String}**: str The string to test.
* **{String|Array}**: patterns One or more glob patterns to use for matching.
* **{Object}**: See available [options](#options).
* `returns` **{Boolean}**: Returns true if any patterns match `str`

@@ -213,21 +208,19 @@ **Example**

```js
var mm = require('micromatch');
mm.isMatch(string, pattern[, options]);
const mm = require('micromatch');
// mm.isMatch(string, patterns[, options]);
console.log(mm.isMatch('a.a', '*.a'));
//=> true
console.log(mm.isMatch('a.b', '*.a'));
//=> false
console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
console.log(mm.isMatch('a.a', 'b.*')); //=> false
```
### [.some](index.js#L192)
### [.not](index.js#L136)
Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
Returns a list of strings that _**do not match any**_ of the given `patterns`.
**Params**
* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found.
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
* `list` **{Array}**: Array of strings to match.
* `patterns` **{String|Array}**: One or more glob pattern to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Boolean}**: Returns true if any patterns match `str`
* `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns.

@@ -237,21 +230,19 @@ **Example**

```js
var mm = require('micromatch');
mm.some(list, patterns[, options]);
const mm = require('micromatch');
// mm.not(list, patterns[, options]);
console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
// true
console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
// false
console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
//=> ['b.b', 'c.c']
```
### [.every](index.js#L228)
### [.contains](index.js#L176)
Returns true if every string in the given `list` matches any of the given glob `patterns`.
Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string.
**Params**
* `list` **{String|Array}**: The string or array of strings to test.
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
* `str` **{String}**: The string to match.
* `patterns` **{String|Array}**: Glob pattern to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Boolean}**: Returns true if any patterns match `str`
* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`.

@@ -262,24 +253,20 @@ **Example**

var mm = require('micromatch');
mm.every(list, patterns[, options]);
// mm.contains(string, pattern[, options]);
console.log(mm.every('foo.js', ['foo.js']));
// true
console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
// true
console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
// false
console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
// false
console.log(mm.contains('aa/bb/cc', '*b'));
//=> true
console.log(mm.contains('aa/bb/cc', '*d'));
//=> false
```
### [.any](index.js#L260)
### [.matchKeys](index.js#L218)
Returns true if **any** of the given glob `patterns` match the specified `string`.
Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead.
**Params**
* `str` **{String|Array}**: The string to test.
* `object` **{Object}**: The object with keys to filter.
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Boolean}**: Returns true if any patterns match `str`
* `returns` **{Object}**: Returns an object with only keys that match the given patterns.

@@ -289,18 +276,17 @@ **Example**

```js
var mm = require('micromatch');
mm.any(string, patterns[, options]);
const mm = require('micromatch');
// mm.matchKeys(object, patterns[, options]);
console.log(mm.any('a.a', ['b.*', '*.a']));
//=> true
console.log(mm.any('a.a', 'b.*'));
//=> false
const obj = { aa: 'a', ab: 'b', ac: 'c' };
console.log(mm.matchKeys(obj, '*b'));
//=> { ab: 'b' }
```
### [.all](index.js#L308)
### [.some](index.js#L247)
Returns true if **all** of the given `patterns` match the specified string.
Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
**Params**
* `str` **{String|Array}**: The string to test.
* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found.
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.

@@ -313,28 +299,21 @@ * `options` **{Object}**: See available [options](#options) for changing how matches are performed

```js
var mm = require('micromatch');
mm.all(string, patterns[, options]);
const mm = require('micromatch');
// mm.some(list, patterns[, options]);
console.log(mm.all('foo.js', ['foo.js']));
console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
// true
console.log(mm.all('foo.js', ['*.js', '!foo.js']));
console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
// false
console.log(mm.all('foo.js', ['*.js', 'foo.js']));
// true
console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
// true
```
### [.not](index.js#L340)
### [.every](index.js#L283)
Returns a list of strings that _**do not match any**_ of the given `patterns`.
Returns true if every string in the given `list` matches any of the given glob `patterns`.
**Params**
* `list` **{Array}**: Array of strings to match.
* `patterns` **{String|Array}**: One or more glob pattern to use for matching.
* `list` **{String|Array}**: The string or array of strings to test.
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns.
* `returns` **{Boolean}**: Returns true if any patterns match `str`

@@ -344,42 +323,25 @@ **Example**

```js
var mm = require('micromatch');
mm.not(list, patterns[, options]);
const mm = require('micromatch');
// mm.every(list, patterns[, options]);
console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
//=> ['b.b', 'c.c']
console.log(mm.every('foo.js', ['foo.js']));
// true
console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
// true
console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
// false
console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
// false
```
### [.contains](index.js#L376)
### [.all](index.js#L322)
Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string.
Returns true if **all** of the given `patterns` match the specified string.
**Params**
* `str` **{String}**: The string to match.
* `patterns` **{String|Array}**: Glob pattern to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`.
**Example**
```js
var mm = require('micromatch');
mm.contains(string, pattern[, options]);
console.log(mm.contains('aa/bb/cc', '*b'));
//=> true
console.log(mm.contains('aa/bb/cc', '*d'));
//=> false
```
### [.matchKeys](index.js#L432)
Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead.
**Params**
* `object` **{Object}**: The object with keys to filter.
* `str` **{String|Array}**: The string to test.
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Object}**: Returns an object with only keys that match the given patterns.
* `returns` **{Boolean}**: Returns true if any patterns match `str`

@@ -389,34 +351,19 @@ **Example**

```js
var mm = require('micromatch');
mm.matchKeys(object, patterns[, options]);
const mm = require('micromatch');
// mm.all(string, patterns[, options]);
var obj = { aa: 'a', ab: 'b', ac: 'c' };
console.log(mm.matchKeys(obj, '*b'));
//=> { ab: 'b' }
```
console.log(mm.all('foo.js', ['foo.js']));
// true
### [.matcher](index.js#L461)
console.log(mm.all('foo.js', ['*.js', '!foo.js']));
// false
Returns a memoized matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match.
console.log(mm.all('foo.js', ['*.js', 'foo.js']));
// true
**Params**
* `pattern` **{String}**: Glob pattern
* `options` **{Object}**: See available [options](#options) for changing how matches are performed.
* `returns` **{Function}**: Returns a matcher function.
**Example**
```js
var mm = require('micromatch');
mm.matcher(pattern[, options]);
var isMatch = mm.matcher('*.!(*a)');
console.log(isMatch('a.a'));
//=> false
console.log(isMatch('a.b'));
//=> true
console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
// true
```
### [.capture](index.js#L536)
### [.capture](index.js#L349)

@@ -427,6 +374,6 @@ Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match.

* `pattern` **{String}**: Glob pattern to use for matching.
* `string` **{String}**: String to match
* `glob` **{String}**: Glob pattern to use for matching.
* `input` **{String}**: String to match
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`.
* `returns` **{Boolean}**: Returns an array of captures if the input matches the glob pattern, otherwise `null`.

@@ -436,4 +383,4 @@ **Example**

```js
var mm = require('micromatch');
mm.capture(pattern, string[, options]);
const mm = require('micromatch');
// mm.capture(pattern, string[, options]);

@@ -446,3 +393,3 @@ console.log(mm.capture('test/*.js', 'test/foo.js'));

### [.makeRe](index.js#L571)
### [.makeRe](index.js#L375)

@@ -454,3 +401,3 @@ Create a regular expression from the given glob `pattern`.

* `pattern` **{String}**: A glob pattern to convert to regex.
* `options` **{Object}**: See available [options](#options) for changing how matches are performed.
* `options` **{Object}**
* `returns` **{RegExp}**: Returns a regex created from the given pattern.

@@ -461,4 +408,4 @@

```js
var mm = require('micromatch');
mm.makeRe(pattern[, options]);
const mm = require('micromatch');
// mm.makeRe(pattern[, options]);

@@ -469,11 +416,11 @@ console.log(mm.makeRe('*.js'));

### [.braces](index.js#L618)
### [.scan](index.js#L391)
Expand the given brace `pattern`.
Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method.
**Params**
* `pattern` **{String}**: String with brace pattern to expand.
* `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options.
* `returns` **{Array}**
* `pattern` **{String}**
* `options` **{Object}**
* `returns` **{Object}**: Returns an object with

@@ -483,61 +430,15 @@ **Example**

```js
var mm = require('micromatch');
console.log(mm.braces('foo/{a,b}/bar'));
//=> ['foo/(a|b)/bar']
console.log(mm.braces('foo/{a,b}/bar', {expand: true}));
//=> ['foo/(a|b)/bar']
const mm = require('micromatch');
const state = mm.scan(pattern[, options]);
```
### [.create](index.js#L685)
### [.parse](index.js#L407)
Parses the given glob `pattern` and returns an array of abstract syntax trees (ASTs), with the compiled `output` and optional source `map` on each AST.
Parse a glob pattern to create the source string for a regular expression.
**Params**
* `pattern` **{String}**: Glob pattern to parse and compile.
* `options` **{Object}**: Any [options](#options) to change how parsing and compiling is performed.
* `returns` **{Object}**: Returns an object with the parsed AST, compiled string and optional source map.
**Example**
```js
var mm = require('micromatch');
mm.create(pattern[, options]);
console.log(mm.create('abc/*.js'));
// [{ options: { source: 'string', sourcemap: true },
// state: {},
// compilers:
// { ... },
// output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js',
// ast:
// { type: 'root',
// errors: [],
// nodes:
// [ ... ],
// dot: false,
// input: 'abc/*.js' },
// parsingErrors: [],
// map:
// { version: 3,
// sources: [ 'string' ],
// names: [],
// mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE',
// sourcesContent: [ 'abc/*.js' ] },
// position: { line: 1, column: 28 },
// content: {},
// files: {},
// idx: 6 }]
```
### [.parse](index.js#L732)
Parse the given `str` with the given `options`.
**Params**
* `str` **{String}**
* `glob` **{String}**
* `options` **{Object}**
* `returns` **{Object}**: Returns an AST
* `returns` **{Object}**: Returns an object with useful properties and output to be used as regex source string.

@@ -547,31 +448,15 @@ **Example**

```js
var mm = require('micromatch');
mm.parse(pattern[, options]);
var ast = mm.parse('a/{b,c}/d');
console.log(ast);
// { type: 'root',
// errors: [],
// input: 'a/{b,c}/d',
// nodes:
// [ { type: 'bos', val: '' },
// { type: 'text', val: 'a/' },
// { type: 'brace',
// nodes:
// [ { type: 'brace.open', val: '{' },
// { type: 'text', val: 'b,c' },
// { type: 'brace.close', val: '}' } ] },
// { type: 'text', val: '/d' },
// { type: 'eos', val: '' } ] }
const mm = require('micromatch');
const state = mm(pattern[, options]);
```
### [.compile](index.js#L780)
### [.braces](index.js#L434)
Compile the given `ast` or string with the given `options`.
Process the given brace `pattern`.
**Params**
* `ast` **{Object|String}**
* `options` **{Object}**
* `returns` **{Object}**: Returns an object that has an `output` property with the compiled string.
* `pattern` **{String}**: String with brace pattern to process.
* `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options.
* `returns` **{Array}**

@@ -581,54 +466,55 @@ **Example**

```js
var mm = require('micromatch');
mm.compile(ast[, options]);
const { braces } = require('micromatch');
console.log(braces('foo/{a,b,c}/bar'));
//=> [ 'foo/(a|b|c)/bar' ]
var ast = mm.parse('a/{b,c}/d');
console.log(mm.compile(ast));
// { options: { source: 'string' },
// state: {},
// compilers:
// { eos: [Function],
// noop: [Function],
// bos: [Function],
// brace: [Function],
// 'brace.open': [Function],
// text: [Function],
// 'brace.close': [Function] },
// output: [ 'a/(b|c)/d' ],
// ast:
// { ... },
// parsingErrors: [] }
console.log(braces('foo/{a,b,c}/bar', { expand: true }));
//=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
```
### [.clearCache](index.js#L801)
## Options
Clear the regex cache.
| **Option** | **Type** | **Default value** | **Description** |
| --- | --- | --- | --- |
| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. |
| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). |
| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. |
| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). |
| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` |
| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. |
| `dot` | `boolean` | `false` | Match dotfiles. Otherwise dotfiles are ignored unless a `.` is explicitly defined in the pattern. |
| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. This option is overridden by the `expandBrace` option. |
| `failglob` | `boolean` | `false` | Similar to the `failglob` behavior in Bash, throws an error when no matches are found. Based on the bash option of the same name. |
| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. |
| `flags` | `boolean` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. |
| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. |
| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. |
| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. |
| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. |
| `lookbehinds` | `boolean` | `true` | Support regex positive and negative lookbehinds. Note that you must be using Node 8.1.10 or higher to enable regex lookbehinds. |
| `matchBase` | `boolean` | `false` | Alias for `basename` |
| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. |
| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. |
| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. |
| `nocase` | `boolean` | `false` | Perform case-insensitive matching. Equivalent to the regex `i` flag. Note that this option is ignored when the `flags` option is defined. |
| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. |
| `noext` | `boolean` | `false` | Alias for `noextglob` |
| `noextglob` | `boolean` | `false` | Disable support for matching with [extglobs](#extglobs) (like `+(a\|b)`) |
| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) |
| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` |
| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. |
| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. |
| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. |
| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
| `posix` | `boolean` | `false` | Support [POSIX character classes](#posix-bracket-expressions) ("posix brackets"). |
| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
| `unescape` | `boolean` | `undefined` | Remove preceding backslashes from escaped glob characters before creating the regular expression to perform matches. |
| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatitibility. |
**Example**
## Options Examples
```js
mm.clearCache();
```
## Options
* [basename](#optionsbasename)
* [bash](#optionsbash)
* [cache](#optionscache)
* [dot](#optionsdot)
* [failglob](#optionsfailglob)
* [ignore](#optionsignore)
* [matchBase](#optionsmatchBase)
* [nobrace](#optionsnobrace)
* [nocase](#optionsnocase)
* [nodupes](#optionsnodupes)
* [noext](#optionsnoext)
* [noglobstar](#optionsnoglobstar)
* [nonull](#optionsnonull)
* [nullglob](#optionsnullglob)
* [snapdragon](#optionssnapdragon)
* [sourcemap](#optionssourcemap)
* [unescape](#optionsunescape)
* [unixify](#optionsunixify)
### options.basename

@@ -645,6 +531,6 @@

```js
mm(['a/b.js', 'a/c.md'], '*.js');
micromatch(['a/b.js', 'a/c.md'], '*.js');
//=> []
mm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true});
micromatch(['a/b.js', 'a/c.md'], '*.js', { basename: true });
//=> ['a/b.js']

@@ -655,3 +541,3 @@ ```

Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as an other star.
Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as any other star.

@@ -665,33 +551,57 @@ **Type**: `Boolean`

```js
var files = ['abc', 'ajz'];
console.log(mm(files, '[a-c]*'));
const files = ['abc', 'ajz'];
console.log(micromatch(files, '[a-c]*'));
//=> ['abc', 'ajz']
console.log(mm(files, '[a-c]*', {bash: false}));
console.log(micromatch(files, '[a-c]*', { bash: false }));
```
### options.cache
### options.expandRange
Disable regex and function memoization.
**Type**: `function`
**Type**: `Boolean`
**Default**: `undefined`
### options.dot
Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need.
Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`.
**Example**
**Type**: `Boolean`
The following example shows how to create a glob that matches a numeric folder name between `01` and `25`, with leading zeros.
**Default**: `false`
```js
const fill = require('fill-range');
const regex = micromatch.makeRe('foo/{01..25}/bar', {
expandRange(a, b) {
return `(${fill(a, b, { toRegex: true })})`;
}
});
### options.failglob
console.log(regex)
//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/
Similar to the `--failglob` behavior in Bash, throws an error when no matches are found.
console.log(regex.test('foo/00/bar')) // false
console.log(regex.test('foo/01/bar')) // true
console.log(regex.test('foo/10/bar')) // true
console.log(regex.test('foo/22/bar')) // true
console.log(regex.test('foo/25/bar')) // true
console.log(regex.test('foo/26/bar')) // false
```
**Type**: `Boolean`
### options.format
**Type**: `function`
**Default**: `undefined`
Custom function for formatting strings before they're matched.
**Example**
```js
// strip leading './' from strings
const format = str => str.replace(/^\.\//, '');
const isMatch = picomatch('foo/*.js', { format });
console.log(isMatch('./foo/bar.js')) //=> true
```
### options.ignore

@@ -705,2 +615,9 @@

```js
const isMatch = micromatch.matcher('*', { ignore: 'f*' });
console.log(isMatch('foo')) //=> false
console.log(isMatch('bar')) //=> true
console.log(isMatch('baz')) //=> true
```
### options.matchBase

@@ -710,5 +627,5 @@

### options.nobrace
### options.noextglob
Disable expansion of brace patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nobrace`.
Disable extglob support, so that [extglobs](#extglobs) are regarded as literal characters.

@@ -719,47 +636,9 @@ **Type**: `Boolean`

See [braces](https://github.com/micromatch/braces) for more information about extended brace expansion.
### options.nocase
Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch).
**Type**: `Boolean`
**Default**: `undefined`
### options.nodupes
Remove duplicate elements from the result array.
**Type**: `Boolean`
**Default**: `undefined`
**Example**
Example of using the `unescape` and `nodupes` options together:
```js
mm.match(['a/b/c', 'a/b/c'], 'a/b/c');
//=> ['a/b/c', 'a/b/c']
mm.match(['a/b/c', 'a/b/c'], 'a/b/c', {nodupes: true});
//=> ['abc']
```
### options.noext
Disable extglob support, so that extglobs are regarded as literal characters.
**Type**: `Boolean`
**Default**: `undefined`
**Examples**
```js
mm(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)');
console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)'));
//=> ['a/b', 'a/!(z)']
mm(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)', {noext: true});
console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)', { noextglob: true }));
//=> ['a/!(z)'] (matches only as literal characters)

@@ -785,6 +664,6 @@ ```

```js
mm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**');
micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**');
//=> ['a/b', 'a/b/c', 'a/b/c/d']
mm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true});
micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true});
//=> ['a/b']

@@ -805,96 +684,95 @@ ```

### options.snapdragon
### options.onIgnore
Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon), to customize parsers or compilers.
```js
const onIgnore = ({ glob, regex, input, output }) => {
console.log({ glob, regex, input, output });
// { glob: '*', regex: /^(?:(?!\.)(?=.)[^\/]*?\/?)$/, input: 'foo', output: 'foo' }
};
**Type**: `Object`
const isMatch = micromatch.matcher('*', { onIgnore, ignore: 'f*' });
isMatch('foo');
isMatch('bar');
isMatch('baz');
```
**Default**: `undefined`
### options.onMatch
### options.sourcemap
```js
const onMatch = ({ glob, regex, input, output }) => {
console.log({ input, output });
// { input: 'some\\path', output: 'some/path' }
// { input: 'some\\path', output: 'some/path' }
// { input: 'some\\path', output: 'some/path' }
};
Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods.
const isMatch = micromatch.matcher('**', { onMatch, posixSlashes: true });
isMatch('some\\path');
isMatch('some\\path');
isMatch('some\\path');
```
_(Note that sourcemaps are currently not enabled for brace patterns)_
### options.onResult
**Examples**
```js
const onResult = ({ glob, regex, input, output }) => {
console.log({ glob, regex, input, output });
};
``` js
var mm = require('micromatch');
var pattern = '*(*(of*(a)x)z)';
var res = mm.create('abc/*.js', {sourcemap: true});
console.log(res.map);
// { version: 3,
// sources: [ 'string' ],
// names: [],
// mappings: 'AAAA,GAAG,EAAC,iBAAC,EAAC,EAAE',
// sourcesContent: [ 'abc/*.js' ] }
var ast = mm.parse('abc/**/*.js');
var res = mm.compile(ast, {sourcemap: true});
console.log(res.map);
// { version: 3,
// sources: [ 'string' ],
// names: [],
// mappings: 'AAAA,GAAG,EAAC,2BAAE,EAAC,iBAAC,EAAC,EAAE',
// sourcesContent: [ 'abc/**/*.js' ] }
var ast = mm.parse(pattern);
var res = mm.compile(ast, {sourcemap: true});
console.log(res.map);
// { version: 3,
// sources: [ 'string' ],
// names: [],
// mappings: 'AAAA,CAAE,CAAE,EAAE,CAAE,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC',
// sourcesContent: [ '*(*(of*(a)x)z)' ] }
const isMatch = micromatch('*', { onResult, ignore: 'f*' });
isMatch('foo');
isMatch('bar');
isMatch('baz');
```
### options.unescape
### options.posixSlashes
Remove backslashes from returned matches.
Convert path separators on returned files to posix/unix-style forward slashes. Aliased as `unixify` for backwards compatibility.
**Type**: `Boolean`
**Default**: `undefined`
**Default**: `true` on windows, `false` everywhere else.
**Example**
In this example we want to match a literal `*`:
```js
mm.match(['abc', 'a\\*c'], 'a\\*c');
//=> ['a\\*c']
console.log(micromatch.match(['a\\b\\c'], 'a/**'));
//=> ['a/b/c']
mm.match(['abc', 'a\\*c'], 'a\\*c', {unescape: true});
//=> ['a*c']
console.log(micromatch.match(['a\\b\\c'], { posixSlashes: false }));
//=> ['a\\b\\c']
```
### options.unixify
### options.unescape
Convert path separators on returned files to posix/unix-style forward slashes.
Remove backslashes from escaped glob characters before creating the regular expression to perform matches.
**Type**: `Boolean`
**Default**: `true` on windows, `false` everywhere else
**Default**: `undefined`
**Example**
In this example we want to match a literal `*`:
```js
mm.match(['a\\b\\c'], 'a/**');
//=> ['a/b/c']
console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c'));
//=> ['a\\*c']
mm.match(['a\\b\\c'], {unixify: false});
//=> ['a\\b\\c']
console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c', { unescape: true }));
//=> ['a*c']
```
<br>
<br>
## Extended globbing
Micromatch also supports extended globbing features.
Micromatch supports the following extended globbing features.
### extglobs
### Extglobs
Extended globbing, as described by the bash man page:
| **pattern** | **regex equivalent** | **description** |
| **pattern** | **regex equivalent** | **description** |
| --- | --- | --- |

@@ -907,10 +785,12 @@ | `?(pattern)` | `(pattern)?` | Matches zero or one occurrence of the given patterns |

<sup><strong>*</strong></sup> Note that `@` isn't a RegEx character.
<sup><strong>*</strong></sup> Note that `@` isn't a regex character.
Powered by [extglob](https://github.com/micromatch/extglob). Visit that library for the full range of options or to report extglob related issues.
### Braces
### braces
Brace patterns can be used to match specific ranges or sets of characters.
Brace patterns can be used to match specific ranges or sets of characters. For example, the pattern `*/{1..3}/*` would match any of following strings:
**Example**
The pattern `{f,b}*/{1..3}/{b,q}*` would match any of following strings:
```

@@ -927,3 +807,3 @@ foo/1/bar

### regex character classes
### Regex character classes

@@ -939,3 +819,3 @@ Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`:

### regex groups
### Regex groups

@@ -957,11 +837,6 @@ Given `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`:

```js
mm.isMatch('a1', '[[:alpha:][:digit:]]');
//=> true
mm.isMatch('a1', '[[:alpha:][:alpha:]]');
//=> false
console.log(micromatch.isMatch('a1', '[[:alpha:][:digit:]]')) //=> true
console.log(micromatch.isMatch('a1', '[[:alpha:][:alpha:]]')) //=> false
```
See [expand-brackets](https://github.com/jonschlinkert/expand-brackets) for more information about bracket expressions.
***

@@ -981,3 +856,3 @@

* Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows. This is consistent with bash behavior.
* Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows, which is consistent with bash behavior. _More importantly, unescaping globs can result in unsafe regular expressions_.
* Minimatch converts all backslashes to forward slashes, which means you can't use backslashes to escape any characters in your glob patterns.

@@ -987,4 +862,4 @@

* consistency with bash conventions.
* glob patterns are not filepaths. They are a type of [regular language](https://en.wikipedia.org/wiki/Regular_language) that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine.
* Consistency with bash conventions.
* Glob patterns are not filepaths. They are a type of [regular language](https://en.wikipedia.org/wiki/Regular_language) that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine.

@@ -997,19 +872,4 @@ **A note about joining paths to globs**

## Contributing
To solve this, you might be inspired to do something like `'foo\\*'.replace(/\\/g, '/')`, but this causes another, potentially much more serious, problem.
All contributions are welcome! Please read [the contributing guide](.github/contributing.md) to get started.
**Bug reports**
Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please:
* [research existing issues first](../../issues) (open and closed)
* visit the [GNU Bash documentation](https://www.gnu.org/software/bash/manual/) to see how Bash deals with the pattern
* visit the [minimatch](https://github.com/isaacs/minimatch) documentation to cross-check expected behavior in node.js
* if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated.
**Platform issues**
It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated).
## Benchmarks

@@ -1019,98 +879,85 @@

Install dev dependencies:
Install dependencies for running benchmarks:
```bash
npm i -d && npm run benchmark
```sh
$ cd bench && npm install
```
### Latest results
Run the benchmarks:
As of February 18, 2018 (longer bars are better):
```sh
# braces-globstar-large-list (485691 bytes)
micromatch ██████████████████████████████████████████████████ (517 ops/sec ±0.49%)
minimatch █ (18.92 ops/sec ±0.54%)
multimatch █ (18.94 ops/sec ±0.62%)
$ npm run bench
```
micromatch is faster by an avg. of 2,733%
### Latest results
# braces-multiple (3362 bytes)
micromatch ██████████████████████████████████████████████████ (33,625 ops/sec ±0.45%)
minimatch (2.92 ops/sec ±3.26%)
multimatch (2.90 ops/sec ±2.76%)
As of April 10, 2019 (longer bars are better):
micromatch is faster by an avg. of 1,156,935%
```sh
# .makeRe star
micromatch x 1,724,735 ops/sec ±1.69% (87 runs sampled))
minimatch x 649,565 ops/sec ±1.93% (91 runs sampled)
# braces-range (727 bytes)
micromatch █████████████████████████████████████████████████ (155,220 ops/sec ±0.56%)
minimatch ██████ (20,186 ops/sec ±1.27%)
multimatch ██████ (19,809 ops/sec ±0.60%)
# .makeRe star; dot=true
micromatch x 1,302,127 ops/sec ±1.43% (92 runs sampled)
minimatch x 556,242 ops/sec ±0.71% (86 runs sampled)
micromatch is faster by an avg. of 776%
# .makeRe globstar
micromatch x 1,393,992 ops/sec ±0.71% (89 runs sampled)
minimatch x 1,112,801 ops/sec ±2.02% (91 runs sampled)
# braces-set (2858 bytes)
micromatch █████████████████████████████████████████████████ (24,354 ops/sec ±0.92%)
minimatch █████ (2,566 ops/sec ±0.56%)
multimatch ████ (2,431 ops/sec ±1.25%)
# .makeRe globstars
micromatch x 1,419,097 ops/sec ±0.34% (94 runs sampled)
minimatch x 541,207 ops/sec ±1.66% (93 runs sampled)
micromatch is faster by an avg. of 975%
# .makeRe with leading star
micromatch x 1,247,825 ops/sec ±0.97% (94 runs sampled)
minimatch x 489,660 ops/sec ±0.63% (94 runs sampled)
# globstar-large-list (485686 bytes)
micromatch █████████████████████████████████████████████████ (504 ops/sec ±0.45%)
minimatch ███ (33.36 ops/sec ±1.08%)
multimatch ███ (33.19 ops/sec ±1.35%)
# .makeRe - braces
micromatch x 206,301 ops/sec ±1.62% (81 runs sampled))
minimatch x 115,986 ops/sec ±0.59% (94 runs sampled)
micromatch is faster by an avg. of 1,514%
# .makeRe braces - range (expanded)
micromatch x 27,782 ops/sec ±0.79% (88 runs sampled)
minimatch x 4,683 ops/sec ±1.20% (92 runs sampled)
# globstar-long-list (90647 bytes)
micromatch ██████████████████████████████████████████████████ (2,694 ops/sec ±1.08%)
minimatch ████████████████ (870 ops/sec ±1.09%)
multimatch ████████████████ (862 ops/sec ±0.84%)
# .makeRe braces - range (compiled)
micromatch x 134,056 ops/sec ±2.73% (77 runs sampled))
minimatch x 977 ops/sec ±0.85% (91 runs sampled)d)
micromatch is faster by an avg. of 311%
# .makeRe braces - nested ranges (expanded)
micromatch x 18,353 ops/sec ±0.95% (91 runs sampled)
minimatch x 4,514 ops/sec ±1.04% (93 runs sampled)
# globstar-short-list (182 bytes)
micromatch ██████████████████████████████████████████████████ (328,921 ops/sec ±1.06%)
minimatch █████████ (64,808 ops/sec ±1.42%)
multimatch ████████ (57,991 ops/sec ±2.11%)
# .makeRe braces - nested ranges (compiled)
micromatch x 38,916 ops/sec ±1.85% (82 runs sampled)
minimatch x 980 ops/sec ±0.54% (93 runs sampled)d)
micromatch is faster by an avg. of 536%
# .makeRe braces - set (compiled)
micromatch x 141,088 ops/sec ±1.70% (70 runs sampled))
minimatch x 43,385 ops/sec ±0.87% (93 runs sampled)
# no-glob (701 bytes)
micromatch █████████████████████████████████████████████████ (415,935 ops/sec ±0.36%)
minimatch ███████████ (92,730 ops/sec ±1.44%)
multimatch █████████ (81,958 ops/sec ±2.13%)
# .makeRe braces - nested sets (compiled)
micromatch x 87,272 ops/sec ±2.85% (71 runs sampled))
minimatch x 25,327 ops/sec ±1.59% (86 runs sampled)
```
micromatch is faster by an avg. of 476%
## Contributing
# star-basename-long (12339 bytes)
micromatch █████████████████████████████████████████████████ (7,963 ops/sec ±0.36%)
minimatch ███████████████████████████████ (5,072 ops/sec ±0.83%)
multimatch ███████████████████████████████ (5,028 ops/sec ±0.40%)
All contributions are welcome! Please read [the contributing guide](.github/contributing.md) to get started.
micromatch is faster by an avg. of 158%
**Bug reports**
# star-basename-short (349 bytes)
micromatch ██████████████████████████████████████████████████ (269,552 ops/sec ±0.70%)
minimatch ██████████████████████ (122,457 ops/sec ±1.39%)
multimatch ████████████████████ (110,788 ops/sec ±1.99%)
Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please:
micromatch is faster by an avg. of 231%
* [research existing issues first](../../issues) (open and closed)
* visit the [GNU Bash documentation](https://www.gnu.org/software/bash/manual/) to see how Bash deals with the pattern
* visit the [minimatch](https://github.com/isaacs/minimatch) documentation to cross-check expected behavior in node.js
* if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated.
# star-folder-long (19207 bytes)
micromatch █████████████████████████████████████████████████ (3,806 ops/sec ±0.38%)
minimatch ████████████████████████████ (2,204 ops/sec ±0.32%)
multimatch ██████████████████████████ (2,020 ops/sec ±1.07%)
**Platform issues**
micromatch is faster by an avg. of 180%
It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated).
# star-folder-short (551 bytes)
micromatch ██████████████████████████████████████████████████ (249,077 ops/sec ±0.40%)
minimatch ███████████ (59,431 ops/sec ±1.67%)
multimatch ███████████ (55,569 ops/sec ±1.43%)
micromatch is faster by an avg. of 433%
```
## About

@@ -1156,3 +1003,3 @@

* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.")
* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.")
* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/micromatch/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.")
* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.")

@@ -1164,18 +1011,21 @@ * [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`")

| **Commits** | **Contributor** |
| --- | --- |
| 457 | [jonschlinkert](https://github.com/jonschlinkert) |
| 12 | [es128](https://github.com/es128) |
| 8 | [doowb](https://github.com/doowb) |
| 3 | [paulmillr](https://github.com/paulmillr) |
| 2 | [TrySound](https://github.com/TrySound) |
| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
| 2 | [charlike-old](https://github.com/charlike-old) |
| 1 | [amilajack](https://github.com/amilajack) |
| 1 | [mrmlnc](https://github.com/mrmlnc) |
| 1 | [devongovett](https://github.com/devongovett) |
| 1 | [DianeLooney](https://github.com/DianeLooney) |
| 1 | [UltCombo](https://github.com/UltCombo) |
| 1 | [tomByrer](https://github.com/tomByrer) |
| 1 | [fidian](https://github.com/fidian) |
| **Commits** | **Contributor** |
| --- | --- |
| 475 | [jonschlinkert](https://github.com/jonschlinkert) |
| 12 | [es128](https://github.com/es128) |
| 8 | [doowb](https://github.com/doowb) |
| 3 | [paulmillr](https://github.com/paulmillr) |
| 2 | [TrySound](https://github.com/TrySound) |
| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
| 2 | [Tvrqvoise](https://github.com/Tvrqvoise) |
| 2 | [tunnckoCore](https://github.com/tunnckoCore) |
| 1 | [amilajack](https://github.com/amilajack) |
| 1 | [mrmlnc](https://github.com/mrmlnc) |
| 1 | [devongovett](https://github.com/devongovett) |
| 1 | [DianeLooney](https://github.com/DianeLooney) |
| 1 | [UltCombo](https://github.com/UltCombo) |
| 1 | [tomByrer](https://github.com/tomByrer) |
| 1 | [fidian](https://github.com/fidian) |
| 1 | [simlu](https://github.com/simlu) |
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |

@@ -1186,9 +1036,9 @@ ### Author

* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
### License
Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

@@ -1198,2 +1048,2 @@

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 18, 2018._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 10, 2019._

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc