Skip to content

Commit

Permalink
use braces patch, build readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Apr 10, 2019
1 parent 976d956 commit a6ab670
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 276 deletions.
64 changes: 32 additions & 32 deletions .verb.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
- 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, and support for escaping special characters with `\` or quotes.
- **[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.
Expand All @@ -43,8 +43,8 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
* Support for multiple glob patterns (no need for wrappers like multimatch)
* Wildcards (`**`, `*.js`)
* Negation (`'!a/*.js'`, `'*!(b).js']`)
* [extglobs][extglob] (`+(x|y)`, `!(a|b)`)
* [POSIX character classes][brackets] (`[[:alpha:][:digit:]]`)
* [extglobs](#extglobs) (`+(x|y)`, `!(a|b)`)
* [POSIX character classes](#posix-bracket-expressions) (`[[:alpha:][:digit:]]`)
* [brace expansion][braces] (`foo/{1..5}.md`, `bar/{a,b,c}.js`)
* regex character classes (`foo-[1-5].js`)
* regex logical "or" (`foo/(abc|xyz).js`)
Expand Down Expand Up @@ -115,7 +115,7 @@ console.log(micromatch(['foo', 'bar', 'baz'], ['f*', '*z'])); //=> ['foo', 'baz'
| [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 POSX character classes ("posix brackets"). |
| `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 `]*`). |
Expand Down Expand Up @@ -381,7 +381,7 @@ console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c', { unescape: true }));

Micromatch supports the following extended globbing features.

### extglobs
### Extglobs

Extended globbing, as described by the bash man page:

Expand All @@ -395,7 +395,7 @@ Extended globbing, as described by the bash man page:

<sup><strong>*</strong></sup> Note that `@` isn't a regex character.

### braces
### Braces

Brace patterns can be used to match specific ranges or sets of characters.

Expand All @@ -414,7 +414,7 @@ baz/3/qux

Visit [braces][] to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues.

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

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

Expand All @@ -425,7 +425,7 @@ Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`:

Learn about [regex character classes][charclass].

### regex groups
### Regex groups

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

Expand Down Expand Up @@ -501,52 +501,52 @@ As of {%= date() %} (longer bars are better):

```sh
# .makeRe star
micromatch x 1,738,334 ops/sec ±1.08% (93 runs sampled))
minimatch x 677,791 ops/sec ±1.97% (92 runs sampled)
micromatch x 1,724,735 ops/sec ±1.69% (87 runs sampled))
minimatch x 649,565 ops/sec ±1.93% (91 runs sampled)

# .makeRe star; dot=true
micromatch x 1,279,934 ops/sec ±1.34% (91 runs sampled)
minimatch x 571,622 ops/sec ±0.41% (88 runs sampled)
micromatch x 1,302,127 ops/sec ±1.43% (92 runs sampled)
minimatch x 556,242 ops/sec ±0.71% (86 runs sampled)

# .makeRe globstar
micromatch x 1,349,874 ops/sec ±0.43% (92 runs sampled)
minimatch x 1,109,129 ops/sec ±1.90% (92 runs sampled))
micromatch x 1,393,992 ops/sec ±0.71% (89 runs sampled)
minimatch x 1,112,801 ops/sec ±2.02% (91 runs sampled)

# .makeRe globstars
micromatch x 1,361,452 ops/sec ±0.48% (91 runs sampled)
minimatch x 548,130 ops/sec ±1.59% (91 runs sampled)
micromatch x 1,419,097 ops/sec ±0.34% (94 runs sampled)
minimatch x 541,207 ops/sec ±1.66% (93 runs sampled)

# .makeRe with leading star
micromatch x 1,197,552 ops/sec ±0.47% (95 runs sampled)
minimatch x 517,443 ops/sec ±0.56% (95 runs sampled)
micromatch x 1,247,825 ops/sec ±0.97% (94 runs sampled)
minimatch x 489,660 ops/sec ±0.63% (94 runs sampled)

# .makeRe - braces
micromatch x 121,082 ops/sec ±2.14% (81 runs sampled))
minimatch x 116,445 ops/sec ±1.53% (95 runs sampled)
micromatch x 206,301 ops/sec ±1.62% (81 runs sampled))
minimatch x 115,986 ops/sec ±0.59% (94 runs sampled)

# .makeRe braces - range (expanded)
micromatch x 26,359 ops/sec ±0.53% (94 runs sampled)
minimatch x 4,535 ops/sec ±0.57% (90 runs sampled)
micromatch x 27,782 ops/sec ±0.79% (88 runs sampled)
minimatch x 4,683 ops/sec ±1.20% (92 runs sampled)

# .makeRe braces - range (compiled)
micromatch x 97,946 ops/sec ±2.12% (84 runs sampled))
minimatch x 1,006 ops/sec ±0.29% (93 runs sampled)
micromatch x 134,056 ops/sec ±2.73% (77 runs sampled))
minimatch x 977 ops/sec ±0.85% (91 runs sampled)d)

# .makeRe braces - nested ranges (expanded)
micromatch x 18,553 ops/sec ±0.96% (90 runs sampled)
minimatch x 4,435 ops/sec ±1.01% (93 runs sampled)
micromatch x 18,353 ops/sec ±0.95% (91 runs sampled)
minimatch x 4,514 ops/sec ±1.04% (93 runs sampled)

# .makeRe braces - nested ranges (compiled)
micromatch x 31,550 ops/sec ±2.40% (81 runs sampled))
minimatch x 987 ops/sec ±0.30% (94 runs sampled)d)
micromatch x 38,916 ops/sec ±1.85% (82 runs sampled)
minimatch x 980 ops/sec ±0.54% (93 runs sampled)d)

# .makeRe braces - set (compiled)
micromatch x 86,669 ops/sec ±1.82% (83 runs sampled))
minimatch x 43,106 ops/sec ±0.78% (94 runs sampled)
micromatch x 141,088 ops/sec ±1.70% (70 runs sampled))
minimatch x 43,385 ops/sec ±0.87% (93 runs sampled)

# .makeRe braces - nested sets (compiled)
micromatch x 56,419 ops/sec ±2.00% (79 runs sampled)
minimatch x 27,150 ops/sec ±0.79% (92 runs sampled)
micromatch x 87,272 ops/sec ±2.85% (71 runs sampled))
minimatch x 25,327 ops/sec ±1.59% (86 runs sampled)
```


Expand Down
Loading

0 comments on commit a6ab670

Please sign in to comment.