1.0.3 • Published 1 year ago

glob-concat v1.0.3

Weekly downloads
74
License
GPLv3
Repository
github
Last release
1 year ago

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.*');