Skip to content

Commit

Permalink
Close #17 PR: Clarify how multiple patterns work in the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
callumlocke authored and sindresorhus committed Sep 20, 2015
1 parent 0cb5f09 commit 186ee64
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ See the [tests](https://github.com/sindresorhus/multimatch/blob/master/test.js)

Same as [`minimatch.match()`](https://github.com/isaacs/minimatch#minimatchmatchlist-pattern-options) except for `pattern` also accepting an array.

```js
var results = multimatch(paths, patterns);
```

The return value is an array of matching paths.


## How multiple patterns work

Positive patterns (e.g. `foo` or `*`) add to the results, while negative patterns (e.g. `!foo`) subtract from the results.

Therefore a lone negation (e.g. `['!foo']`) will never match anything – use `['*', '!foo']` instead.


## Globbing patterns

Expand Down

0 comments on commit 186ee64

Please sign in to comment.