https://github.com/azer/flat-glob
Return glob applied, flattened and duplicate filtered version of the given list of filenames
https://github.com/azer/flat-glob
Last synced: 11 months ago
JSON representation
Return glob applied, flattened and duplicate filtered version of the given list of filenames
- Host: GitHub
- URL: https://github.com/azer/flat-glob
- Owner: azer
- Created: 2014-01-19T08:24:28.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-11-07T16:22:04.000Z (over 9 years ago)
- Last Synced: 2024-11-10T07:43:55.175Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 8
- Watchers: 3
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## flat-glob
Return glob applied, flattened and duplicate filtered version of the given list of filenames
## Install
```bash
$ npm install flat-glob
```
## Usage
```js
flatGlob = require('flat-glob')
flatGlob.sync(['foo.js', 'styles/**/*.css', 'templates/index.html', 'templates/**/*.html'])
// => ['foo.js', 'styles/a.css', 'styles/b.css', 'templates/index.html', 'templates/foo.html', 'templates/bar.html']
flatGlob(['foo.js', 'styles/**/*.css', 'templates/index.html', 'templates/**/*.html'], function (error, files) {
if (error) throw error
files
// => ['foo.js', 'styles/a.css', 'styles/b.css', 'templates/index.html', 'templates/foo.html', 'templates/bar.html']
})
```