get-files-matching-glob

1.0.4 • Public • Published

Utility function to cache glob results

Build Status Coverage Status Maintainability

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.

How to use

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

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

/get-files-matching-glob/

    Package Sidebar

    Install

    npm i get-files-matching-glob

    Weekly Downloads

    0

    Version

    1.0.4

    License

    BSD-3-Clause

    Unpacked Size

    15 kB

    Total Files

    13

    Last publish

    Collaborators

    • sformisano