Install bash 4.3 or later
I recommend using homebrew to install/upgrade bash:
$ brew upgrade bash
The initial motivation was to use this for generating the expected
values for comparisons in tests. But as it turns out, this is faster than node-glob in most cases I've tested.
Moreover, this supports the majority of the feature-functionaly in node-glob, and it's more Bash-compliant since, well, it is Bash.
Edge cases
Inevitably there will be edge cases. Thus far, however, I've found that many of the edge cases that seem to be problematic are already addressed or not problematic for Bash.
Please feel free to create an issue if you find a bug or have a feature request.
var glob = require('{%= name %}');
glob(pattern[, options]);
{%= apidocs("index.js") %}
The following options may be used with the main glob
function or any other method:
dotglob
: (ordot
, for [node-glob][] compatibility) Includes filenames beginning with a.
(dot) in the results of pathname expansion.extglob
: Enable extended pattern matching features.failglob
: If set, patterns that fail to match filenames during pathname expansion result in an error message.globstar
: Enable recursive globbing with**
.nocaseglob
: (ornocase
, for [node-glob][] compatibility) Enable case-insensitive matching in filenames when performing pathname expansion.nullglob
: If set, Bash allows patterns which match no files to expand to a null string, rather than themselves.