Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # multimatch [![Build Status](https://travis-ci.org/sindresorhus/multimatch.svg?branch=master)](https://travis-ci.org/sindresorhus/multimatch)
  2. > Extends [`minimatch.match()`](https://github.com/isaacs/minimatch#minimatchmatchlist-pattern-options) with support for multiple patterns
  3. ## Install
  4. ```
  5. $ npm install multimatch
  6. ```
  7. ## Usage
  8. ```js
  9. const multimatch = require('multimatch');
  10. multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake']);
  11. //=> ['unicorn', 'rainbows']
  12. ```
  13. See the [tests](https://github.com/sindresorhus/multimatch/tree/master/test) for more usage examples and expected matches.
  14. ## API
  15. ### multimatch(paths, patterns, [options]
  16. Returns an array of matching paths.
  17. #### paths
  18. Type: `string | string[]`
  19. Paths to match against.
  20. #### patterns
  21. Type: `string | string[]`
  22. Globbing patterns to use. For example: `['*', '!cake']`. See supported [`minimatch` patterns](https://github.com/isaacs/minimatch#usage).
  23. - [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
  24. - [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
  25. #### options
  26. Type: `object`
  27. See the [`minimatch` options](https://github.com/isaacs/minimatch#options).
  28. ## How multiple patterns work
  29. Positive patterns (e.g. `foo` or `*`) add to the results, while negative patterns (e.g. `!foo`) subtract from the results.
  30. Therefore a lone negation (e.g. `['!foo']`) will never match anything – use `['*', '!foo']` instead.
  31. ## Globbing patterns
  32. Just a quick overview.
  33. - `*` matches any number of characters, but not `/`
  34. - `?` matches a single character, but not `/`
  35. - `**` matches any number of characters, including `/`, as long as it's the only thing in a path part
  36. - `{}` allows for a comma-separated list of "or" expressions
  37. - `!` at the beginning of a pattern will negate the match
  38. ## Related
  39. - [globby](https://github.com/sindresorhus/globby) - Match against the filesystem instead of a list
  40. - [matcher](https://github.com/sindresorhus/matcher) - Simple wildcard matching
  41. ## License
  42. MIT © [Sindre Sorhus](https://sindresorhus.com)