Merge a mixed list of files and globs into a list of files.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
.travis.yml
LICENSE
index.js
package.json
readme.md

readme.md

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