https://github.com/gemini-testing/glob-extra
https://github.com/gemini-testing/glob-extra
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gemini-testing/glob-extra
- Owner: gemini-testing
- License: mit
- Created: 2016-08-12T08:41:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T19:28:56.000Z (almost 3 years ago)
- Last Synced: 2025-04-07T19:11:37.606Z (3 months ago)
- Language: JavaScript
- Size: 212 KB
- Stars: 0
- Watchers: 5
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# glob-extra
Wrapper for utility [fast-glob](https://github.com/mrmlnc/fast-glob) with promises support which provides expanding of masks, dirs and files to absolute file paths.
[](https://www.npmjs.org/package/glob-extra)
[](https://travis-ci.org/gemini-testing/glob-extra)
[](https://coveralls.io/r/gemini-testing/glob-extra?branch=master)
[](https://david-dm.org/gemini-testing/glob-extra)## Installation
```bash
$ npm install glob-extra
```## Usage
```js
const globExtra = require('glob-extra');
const paths = ['some/path', 'other/path/*.js', 'other/deep/path/**/*.js']// options are optional
globExtra.expandPaths(paths, options)
.then((files) => {
// ['/absolute/some/path/file1.js',
// '/absolute/other/path/file2.js',
// '/absolute/other/deep/path/dir/file3.js']
})
.done();
```### Options
* **formats** *{String[]}* – files formats to expand; it will expand all files by default. For example:
```js
globExtra.expandPaths(paths, {formats: ['.txt', '.js']})
.then((files) => {
// will expand only js and txt files
})
.done();
```