:rocket: It's a very fast and efficient glob library for Node.js
/*
, /tmp/*
, //?/C:/*
.markDirectories
option (#287, thanks @yarastqt).In the #156 issue we've redesigned the deep filter, which controls the reading of directories in depth.
Previously, this filter did not use positive patterns directly (only their maximum depth). The example below shows how many extra directories we read:
{src,fixtures}/**
src → read
fixtures → read
out → read
node_modules → read
Now we apply positive patterns.
{src,fixtures}/**
src → read
fixtures → read
out → skip
node_modules → skip
More benchmarks can be found here.
{fixtures,out}/{first,second}/*
sync, ms | async, ms | stream, ms | |
---|---|---|---|
3.x.x | 13 | 22 | 20 |
3.2.0 | 5 | 9 | 8 |
{fixtures,out}/**
sync, ms | async, ms | stream, ms | |
---|---|---|---|
3.x.x | 37 | 49 | 52 |
3.2.0 | 6 | 10 | 12 |
{a..z}
(or similar) may introduce some slowdown.fast-glob
is 2 times slower than node-glob
in this scenario.We will work on this in the future.
scan
method in picomatch
that returns parts of the pattern.Previously, we read directories in the stream, even after the receiver is closed. Now we stop reading after closing the receiver by .emit('end')
, .destroy()
or for await...of
.
const fg = require('fast-glob');
(async () => {
const stream = fg.stream('**');
for await (const entry of stream) {
console.log(entry);
return;
}
})();
Most likely, in future releases, we will improve integration with streams (#243).
isDynamicPattern
as an alternative to glob.hasMagic
(#105)escapePath
for escaping parts of the paths of the pattern (#158)generateTasks
helper.dot
option..
in {dot: false}
mode (#226)This is a maintenance release.
onlyFiles
option in the documentation (thanks, @garyking)strictSlashes
option (internal) for the micromatch package. Related to https://github.com/micromatch/picomatch/issues/21.markDirectories
option adds extra slashes for every directory in the path with the asynchronous API (#214)