Skip to content

AustinMontoya/glob-expander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/*'] 

About

Expand a glob into explicit directory references

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published