npm fast-glob 2.0.0

latest releases: 3.3.2, 3.3.1, 3.3.0...
6 years ago

Faster. Stable. Flexible. Modern.

๐Ÿ’ฃ Breaking Changes

The new version has some fundamental differences.

Drop bashNative mode

In 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.

Other

  • Now we only work with array of strings in the ignore option. See more details here: options#ignore.
  • The onlyDirs option has been renamed to onlyDirectories. See more details here: options#onlyDirectories.
  • The onlyFiles option is now enabled by default. See more details here: options#onlyFiles.

๐Ÿš€ Speed

Now we are faster.

Exclude directories

Now you can say goodbye to your node_modules directory. Please read ยซHow to exclude directory from reading?ยป section in the documentation.

Smart directory reading

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

More speed optimizations

  • Now we use the 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.

๐Ÿšฅ Stability

We just became more stable by fixing a few bugs.

๐Ÿ”จ Flexibility

More options to compare with node-glob

Other

Don't miss a new fast-glob release

NewReleases is sending notifications on new releases.