NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #145 most downloaded on npm
It's a very fast and efficient glob library for Node.js
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 1.2 years
Nearly every release is documented
notes for 39 of 40 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
44 releases · first in 2016
Refer to micromatch@4.0.8 to avoid annoying npm audit spam ( #443 , #444 , #454 , #456 , #457 , #461 )
Handle square brackets as a special character on Windows in escape functions
One column per quarter.
Full Changelog: 3.3.1...3.3.2
This release fixes a regression for cases where the ignore option is used with a string ( #403 , #404 ).
Full Changelog: 3.3.0...3.3.1
This release fixes a regression for cases where the ignore option is used with a string (#403, #404).
The public interface of this package does not support a string as the value for the ignore option since 2018 year (release).
So, in the next major release, we will reintroduce method implementations that do not involve strings in the ignore option.
New methods ( glob , globSync , globStream ) have been added in addition to the current methods (default import, sync , stream ), which eliminate the
Full Changelog: 3.2.12...3.3.0
Method aliases
New methods (glob, globSync, globStream) have been added in addition to the current methods (default import, sync, stream), which eliminate the need to rename the method when importing. In addition, an async alias has been added for the default import, which makes it possible to use this packet with ESM.
Method to convert paths to globs
A new method (convertPathToPattern) has been added in this release to convert a path to a pattern. The primary goal is to enable users to avoid processing Windows paths in each location where this package is used by utilities from third-party packages.
See more details in the pull request.
baseNameMatch option was enabled, which went against the documented behavior. (#312)micromatch package does not correctly generate a regular expression (#365).dot option enabled when matching paths. Previously, the !**/* patterns did not exclude hidden files (start with a dot). (#343)['./file.md', 'file.md', '*'] will now only include file.md once in the results. (#190)A clarifying note has been added for the concurrency option, which provides more detailed information about the Thread Pool utilization.
Fixed an issue introduced in 3.2.7 related to incorrect application of patterns to entries with a trailing slash when the entry is not a directory.
Full Changelog: 3.2.11...3.2.12
Fixed an issue introduced in 3.2.7 related to incorrect application of patterns to entries with a trailing slash when the entry is not a directory.
Before changes:
fg.sync('**/!(*.md)')
// ['file.md', 'a/file.md', 'a/file.txt']After fix:
fg.sync('**/!(*.md)')
// ['a/file.txt']Thanks @AgentEnder for the issue (#357).
This release includes performance improvements for the asynchronous method. For this method we now use an asynchronous directory traversal interface instead of using a streaming interface. This gives up to 15% acceleration for medium and large directories. The result depends a lot on hardware.
You can find the benchmark results for this release in CI here.
Here are a few of measurements on my laptop:
===> Benchmark pattern "*" with 100 launches (regression, async)
===> Max stdev: 7 | Retries: 3 | Options: {}
Name Time, ms Time stdev, % Memory, MB Memory stdev, % Entries Errors Retries
--------------------- -------- ------------- ---------- --------------- ------- ------ -------
fast-glob-current.js 4.390 0.252 6.253 0.015 4 0 1
fast-glob-previous.js 5.653 0.633 6.051 0.056 4 0 1
===> Benchmark pattern "**" with 100 launches (regression, async)
===> Max stdev: 7 | Retries: 3 | Options: {}
Name Time, ms Time stdev, % Memory, MB Memory stdev, % Entries Errors Retries
--------------------- -------- ------------- ---------- --------------- ------- ------ -------
fast-glob-current.js 34.587 1.287 10.654 0.607 11835 0 1
fast-glob-previous.js 41.972 2.086 10.236 1.224 11835 0 1Yeap, this is another release aimed at fixing problems with detecting brace expansions in patterns. This time, patterns like abc/{a.txt,b.js} was not
Full Changelog: 3.2.10...3.2.11
Yeap, this is another release aimed at fixing problems with detecting brace expansions in patterns. This time, patterns like abc/{a.txt,b.js} was not marked as a dynamic pattern. So, now the regex has been rewritten to a generalized solution as a function to avoid future problems due to the complexity of the regular expression.
Fixed a regression in 3.2.8 when the {a,b,c} pattern no longer considered a dynamic pattern (thanks @amitdahan , #347 ).
Full Changelog: 3.2.9...3.2.10
3.2.8 when the {a,b,c} pattern no longer considered a dynamic pattern (thanks @amitdahan, #347).Fixed a regression in 3.2.8 with invalid regular expression on older node.js versions ( #345 ).
Full Changelog: 3.2.8...3.2.9
3.2.8 with invalid regular expression on older node.js versions (#345).Fix directory matching with trailing slashes
Full Changelog: 3.2.7...3.2.8
Thanks @Trott for investigating the problem and the detailed description.
Previously the src/*/ pattern did not work as expected (like src/*).
Starting from this release, patterns like src//* will work like similar patterns without duplicate slashes. This was done for continuity with other solutions (glob, ls src//*, python, golang, …).
Thanks @Trott for fixing bugs and @XhmikosR for adding the CodeQL action to CI pipeline.
The previous release ( 3.2.6 ) introduced a regression, which makes negative patterns were not applied to patterns outside the current directory.
The previous release (3.2.6) introduced a regression, which makes negative patterns were not applied to patterns outside the current directory.
This release fixes the issue.
The glob-parent package has been updated to fix vulnerabilities.
// Patterns inside current directory → ['*', './*.js']
// Patterns outside current directory → ['../*', './../*.js']
// Previously you could specify a patterns outside current directory.
fg.sync(['../*.txt']) → ['../file.txt']
// But when the pattern inside current directory was added to them, the behavior broke down.
fg.sync(['*.md', '../*.txt']) → ['file.md'] // The '../file.txt' file exists
// After this fix you can mix both kinds of patterns.
fg.sync(['*.md', '../*.txt']) → ['file.md', '../file.txt']
// Right now we do not support patterns like '{.,..}/*.md'.
followSymbolicLinks option.glob-parent package has been updated to fix vulnerabilities. (#304)micromatch package has been updated to eliminate dependency on the picomatch package from this package. (#256)tiny-glob package has been added to the synchronous product benchmarks. (#323)fdir package has been added to synchronous and asynchronous product benchmarks. The latest launch. (#322).npmignore file has been replaced by the files field in the package.json file. (#321)Now this packages correctly supports ARM processors (#296, thanks @yozman).
/*, /tmp/*, //?/C:/*.markDirectories option (#287, thanks @yarastqt).Fixed a regression in 3.2.3 when the caseSensitiveMatch option is disabled
3.2.3 when the caseSensitiveMatch option is disabled (#276)Fixed an issue when the unique option led to incorrect results when mixing static and dynamic patterns
unique option led to incorrect results when mixing static and dynamic patterns (#268)Fix a problem with patterns with leading dot segment (like ./… or .\\…)
./… or .\\…) (#257)## 💬 Common * Temporary fix for #253.
Nothing published for this version
Nothing published for this version
An empty pattern now causes an error
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.Nothing published for this version
Nothing published for this version
Previously, we read directories in the stream, even after the receiver is closed. Now we stop reading after closing the receiver by .emit('end'), .des
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).
New method `isDynamicPattern` as an alternative to `glob.hasMagic`
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.
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.Correct method for the Stream API in the documentation (#217, thanks @bluelovers)
markDirectories option adds extra slashes for every directory in the path with the asynchronous API (#214)> The fast-glob3.0.0 was released with one known bug. This release fixes it.
The
fast-glob3.0.0was released with one known bug. This release fixes it.
4 000 0004.1GB of RAM (37s)0.8GB of RAM (25s)In short, we called 2x replace and startsWith on every entry. Together, that's 12 million calls.
Fix TypeScript import issue (https://github.com/mrmlnc/fast-glob/pull/206, thanks @zkochan).
import issue (https://github.com/mrmlnc/fast-glob/pull/206, thanks @zkochan).Since this is a major release, we are introducing a few breaking changes:
withFileTypes option in the fs.readdir method.This release aims to fix architectural issues, increase performance and reduce size of package.
Since this is a major release, we are introducing a few breaking changes:
fast-glob@2 is ending.README.md file.nobrace, noglobstar, noext, nocase, transform.extension → extglobfollowSymlinkedDirectories → followSymbolicLinkscase → caseSensitiveMatchbrace → braceExpansionmatchBase → baseNameMatchdeep option now accepts only number type and default value now is Infinity instead of true.async method was removed. Use fg(/* … */) instead.stats option is enabled is completely changed.micromatch@3 to micromatch@4:
baseNameMatch option never worked (https://github.com/mrmlnc/fast-glob/issues/199).2.47MB → 0.42MB.require time decreased: 534ms → 78ms.Wow! The new version is very fast. At least twice as fast as the previous version. Probably this is the fastest solution in the Node.js world. And that's not all! We will work on performance issues in the future 🐢.
Look at the benchmarks section in the README.md file.
Also in this release we have worked on simplifying some scenarios.
Now, thanks to the new mechanism, you can get the type of entry without additional costs! Works only on Node.js 10.10+. Look at the
objectModeoption.
Added description of how to work with UNC paths
ignore option takes an array (#184 — thanks @lukeis for contributing)case option.Thanks @stevenvachon for issue reporting :tada:
If the user has passed a . or .. and the absolute option is enabled, the paths of the found entries were not absolute (they contained . or `..).
before
fg.sync('/project/temp/../*.js', { absolute: true }); // → ['/project/temp/../something.js']
after
fg.sync('/project/temp/../*.js', { absolute: true }); // → ['/project/something.js']
case option not work with static patterns (#172)Thanks @davidmerfield for issue reporting :tada:
For performance reasons with fast-glob@2.1.0 we introduce static patterns (patterns without glob magic).
Unfortunately, then we forgot about supporting the case (nocase) option. Now the case option works fine with static patterns too. We also improved the documentation for this option.
directory/
- file.txt
- File.txt
before
fg.sync('file.txt', { case: false }) // → ['file.txt']
after
fg.sync('file.txt', { case: false }) // → ['file.txt', 'File.txt']
Thanks @vladshcherbin for issue reporting and contributing :tada:
This is also related to static patterns.
Previously we mark patterns like assets/?ss.css to static and tried to find such file on file system. Now it will works fine.
before
fg.sync('assets/?ss.css'); // → []
after
fg.sync('assets/?ss.css'); // → ['asserts/css.css']
:warning: This is a recovery release for https://github.com/mrmlnc/fast-glob/issues/144.
:warning: This is a recovery release for https://github.com/mrmlnc/fast-glob/issues/144.
> Thanks @felixbecker for issue reporting :tada:
Thanks @felixbecker for issue reporting :tada:
#140
This package is able to build tasks on the basis of passed patterns for their parallel execution. In some cases there may be multiple. In the Stream API, each task produces its own Node.js Stream. Once the streams are created, we combine them into a single stream using the merge2 package.
Before this fix, if an error occurs anywhere inside one of streams, it did not propagate to the combined stream, causing an unhandled exception.
For example, when a directory is deleted while it is being globbed with the stream API…
After this fix, all errors will be propagated to the combined stream. One exception is ENOENT errors – they will be ignored in all streams.
Unfortunately, not everyone uses TypeScript. Now we are clearly saying that we only accept strings as input.
Unfortunately, not everyone uses TypeScript. Now we are clearly saying that we only accept strings as input.
Now we support the absolute negative patterns. You can read more about this in the documentation.
📖 Works only when the
absoluteoption is enabled.
We fixed a bug in the mechanism of determining the minimum required depth for reading.
📖 In some cases, we will still read more than we need to, because in the current implementation we cannot accurately determine the depth of the read. But we will work on this further within #53.
For example, the user wrote the following pattern: fixtures/*.
Prior to release of this version, FastGlob could read more directories than it needed:
./fixtures
└── one 👍
└── two 👍
└── three 👍
└── four ❌
└── index.js
Right now:
./fixtures
└── one ❌
└── two
└── three
└── four
└── index.js
markDirectories options does not work when the absolute option is enabled(#121)Now it works correctly. Thanks @rijnhard for fix it 🎉
deep options works incorrectly (#129)Fixed the problem of incorrect depth reading limit when using the deep option.
Prior to this fix, not all negative patterns could be applied to tasks. For example:
Thanks @DudaGod for fix it 🎉
Prior to this fix, not all negative patterns could be applied to tasks. For example:
fg('fixtures/first/**/*.md', {ignore: ['fixtures/**/*.md']}).then(console.log);
Give a task:
{ base: 'fixtures/first',
dynamic: true,
patterns: [ 'fixtures/first/**/*.md' ],
positive: [ 'fixtures/first/**/*.md' ],
negative: [] } // Here must be a negative pattern
Now the fast-glob package officially supports Node.js 10.
fast-glob package officially supports Node.js 10.We started migrating to @nodelib packages, which will allow us to fully control the process of package development and some performance improvements (for example, see @nodelib/scandir where we can filter entries before we get fs.Stats) (#104)
Previously, we skipped negative patterns whose base paths did not fully matched with the base path of the positive pattern. For more details about this situation take a look at #107.
In some cases, the ! symbol may not mean that we are working with a negative pattern.
The
!(a|b|c)pattern is matches anything except one of the given patterns.
Allow to use negative patterns in the «ignore» option (#86).
The ability to export tasks from package. See more information in the `README.md` file.
README.md file.Now all patterns are divided into two types:
Now all patterns are divided into two types:
static
The patterns without glob magic.
For example: package.json, /dev/fd, etc.
dynamic
The patterns with glob magic detected by is-glob.
For example: *.json, **/*.js, etc.
This made it possible to reduce the processing time of static patterns. Something like 10-15 times. For more details, see the issue #60. Thanks @pvdlg for reporting.
New options that allow you not to break your brain. User-friendly alternatives for double-negative options:
⚠️ These options have more weight than their ancestors (
no*).
:exclamation: In the next major release, we want to remove the options with double-negation.
Use readdir-enhanced package from npm instead of referring to a branch on the GitHub, because it requires an installed git client (#57).
readdir-enhanced package from npm instead of referring to a branch on the GitHub, because it requires an installed git client (#57).Fix problem when onlyFiles & onlyDirectories options is enabled in the one time
onlyFiles & onlyDirectories options is enabled in the one time (#51)Now we are faster. Almost.
/** (slash and globstar) (#45).Fix «Maximum call stack size exceeded» exception for large directories. So, we temporary switch to readdir-enhanced fork with *monkey patch of problem
readdir-enhanced fork with monkey patch of problem. (#23, #42, #44).This is a maintenance patch release that includes following changes:
This is a maintenance patch release that includes following changes:
Options interface if you are using TypeScript.@types/readdir-enhanced package instead of your own types.Some magic for benchmarks 🎉
Please, read 2.0.0 announcement.
Faster. Stable. Flexible. Modern.
Faster. Stable. Flexible. Modern.
The new version has some fundamental differences.
bashNative modeIn the previous version we used the bash-glob package that provided a wrapper for the ls command to Node.js world. Unfortunately, this package had a lot of problems with shell customizations and macOS. So, in the new version of the fast-glob package we refused to use this package.
ignore option. See more details here: options#ignore.onlyDirs option has been renamed to onlyDirectories. See more details here: options#onlyDirectories.onlyFiles option is now enabled by default. See more details here: options#onlyFiles.Now we are faster.
Now you can say goodbye to your node_modules directory. Please read «How to exclude directory from reading?» section in the documentation.
Now we read in depth only those directories that must be read. For example, we have the following pattern:
src/{images,icons}/*/_*.png
In the previous version we read all directories inside the src directory. Now we will read only two directories (images and icons) and one level of directories each of these directories.
src/
├── images/ ← # read
│ ├── file.png
│ └── nested/ ← # read
│ ├── file.png
│ └── wow/ ← # not read
└── icons/ ← # read
├── file.png
└── nested/ ← # read
└── file.png
micromatch as a package for the generation of regular expressions. Why? Because the package has intelligent caching, which slows the search for already prepared the regular expressions in the cache. Something around 15ms for 1000 occurrences.We just became more stable by fixing a few bugs.
node-globdotfollowSymlinkedDirectoriesuniquemarkDirectoriesabsolutenobracenoglobstarnoextnocasematchBaseReadableStream adapter.Fix abolute path issues and ENOENT error when there are no matches (Thanks @alan-agius4 – #10)
Changelog:
ENOENT error when there are no matches (Thanks @alan-agius4 – #10)Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →