JSPM

glob-expander

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q12965F
  • License MIT

expand a glob into an equivalent list of subdirectories

Package Exports

  • glob-expander

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (glob-expander) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Glob expander

Expand your globs into an equivalent list of directories.

This was primarily created to work around the gaze issue that prevents files being added in subdirectories from being picked up as part of the watch process.

Note that this does not attempt to expand more complex minimatch patterns, like those including brackets or negations; instead, it returns the original pattern as part of the result.

Installs via npm:

npm install glob-expander

Example

Given the following directory structure:


gulpfile.js
public/
 js/
   app/
       foo.js
   test/
     bar.js
server/
  routes/
        r1.js
        r2.js

In gulpfile.js:

var expandGlob = require('glob-expander');

// Expand a single glob
expandGlob('public/**/*.js'); // ['public/js/*.js', 'public/js/app/*.js', 'public/js/test/*.js'] 

// Expand multiple globs 
expandGlob(['public/**/*.js', 'server/**']); 
// ['public/js/*.js', 'public/js/app/*.js', 'public/js/test/*.js', 'server/*', 'server/routes/*']