Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

glob-extra

gemini-testing1.7kMIT5.0.2TypeScript support: included

Utility which provides expanding of masks, dirs and files to absolute file paths.

expand, paths, masks

readme

glob-extra

Wrapper for utility fast-glob with promises support which provides expanding of masks, dirs and files to absolute file paths.

NPM version Build Status Coverage Status Dependency Status

Installation

$ npm install glob-extra

Usage

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:
globExtra.expandPaths(paths, {formats: ['.txt', '.js']})
    .then((files) => {
        // will expand only js and txt files
    })
    .done();

changelog

Changelog

1.3.0 - 2016-10-01

  • Added possibility to use glob opts

1.2.0 - 2016-09-05

  • Initial release