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.

58 lines
1.7 KiB

4 years ago
  1. # globs
  2. An extension of [glob], allowing you to provide one or more patterns to match.
  3. ## usage
  4. ```js
  5. var globs = require('globs');
  6. // a single pattern
  7. globs('**/*.js', function (err, files) {
  8. if (err) {
  9. throw err;
  10. }
  11. console.log('matched:', files);
  12. });
  13. // multiple patterns
  14. globs([ '**/*.js', '/foo/bar/*.coffee' ], function (err, files) {
  15. if (err) {
  16. throw err;
  17. }
  18. console.log('matched:', files);
  19. });
  20. // sync
  21. var files = globs.sync([ '**/*.js', '/foo/bar/*.coffee' ], { option: 'stuff' });
  22. ```
  23. ## License
  24. (The MIT License)
  25. Copyright (c) 2013 Stephen Mathieson <me@stephenmathieson.com>
  26. Permission is hereby granted, free of charge, to any person obtaining
  27. a copy of this software and associated documentation files (the
  28. 'Software'), to deal in the Software without restriction, including
  29. without limitation the rights to use, copy, modify, merge, publish,
  30. distribute, sublicense, and/or sell copies of the Software, and to
  31. permit persons to whom the Software is furnished to do so, subject to
  32. the following conditions:
  33. The above copyright notice and this permission notice shall be
  34. included in all copies or substantial portions of the Software.
  35. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  36. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  37. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  38. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  39. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  40. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  41. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  42. [glob]: https://github.com/isaacs/node-glob