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 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # globby [![Build Status](https://travis-ci.org/sindresorhus/globby.svg?branch=master)](https://travis-ci.org/sindresorhus/globby)
  2. > Extends [glob](https://github.com/isaacs/node-glob) with support for multiple patterns
  3. ## Install
  4. ```
  5. $ npm install --save globby
  6. ```
  7. ## Usage
  8. ```
  9. ├── unicorn
  10. ├── cake
  11. └── rainbow
  12. ```
  13. ```js
  14. var globby = require('globby');
  15. globby(['*', '!cake'], function (err, paths) {
  16. console.log(paths);
  17. //=> ['unicorn', 'rainbows']
  18. });
  19. ```
  20. ## API
  21. ### globby(patterns, [options], callback)
  22. ### globby.sync(patterns, [options])
  23. #### patterns
  24. *Required*
  25. Type: `string`, `array`
  26. See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage).
  27. #### options
  28. Type: `object`
  29. See the node-glob [options](https://github.com/isaacs/node-glob#options).
  30. #### callback(err, paths)
  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. [Various patterns and expected matches](https://github.com/sindresorhus/multimatch/blob/master/test.js).
  39. ## Related
  40. - [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem.
  41. - [glob-stream](https://github.com/wearefractal/glob-stream) - Streaming alternative.
  42. ## License
  43. MIT © [Sindre Sorhus](http://sindresorhus.com)