Skip to content

fitnr/glob-concat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glob-concat

Node utility for merging a list of globs or files into a single unique list.

Rougly equivalent to the bash command: find . -name '<pattern>' -or -name '<pattern>' ....

Run synchronously or asynchronously.

globConcat.sync(['tests/item.*', 'tests/*.txt']);

// ['tests/item.txt', 'tests/item.bar', 'tests/foo.txt']

globConcat(['tests/item.*', 'tests/*.txt'], function(err, matches) {
    if (err) throw err;
    /* do stuff with matches */
});

Just a thin wrapper around glob, options are passed on.

var opts = {nonull: true};

globConcat(['tests/item.*', 'tests/*.txt'], opts, function(err, matches) {
    if (err) throw err;
    /* do stuff with matches */
});

Happily accepts a single string as input.

// this is the same as running glob.sync
globConcat.sync('tests/item.*');

About

Merge a mixed list of files and globs into a list of files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published