Skip to content

gemini-testing/glob-extra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
oldskytree
Sep 6, 2022
8d5a15d · Sep 6, 2022

History

69 Commits
Sep 2, 2022
Sep 6, 2022
Sep 6, 2022
Sep 6, 2022
Sep 6, 2022
Sep 6, 2022
Aug 19, 2016
Jul 3, 2019
Sep 19, 2016
Sep 30, 2016
Sep 4, 2016
Sep 19, 2016
Oct 2, 2018
Sep 6, 2022
Sep 6, 2022
Sep 6, 2022

Repository files navigation

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();