Skip to content

sformisano/get-files-matching-glob

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Utility function to cache glob results

Build Status Coverage Status Maintainability License

NPM

Takes a glob pattern as argument, checks the cache to see if data has already been requested for this pattern. If there's cached data, returns it. If not, returns the matching files and caches them. Throws an exception if no files match the glob pattern or if the argument passed to the glob pattern parameter is not a string.

Instructions

Install

npm install --save get-files-matching-glob

Usage

const getFilesMatchingGlob = require('get-files-matching-glob')

const useCache = true // true/false to cache paths (defaults to true)
const myFiles = getFilesMatchingGlob('some/glob/string/**/*.js', useCache)

// do whatever you want with myFiles which will be an array of all the matching files found

About

Glob functionality with cached outputs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published