Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tinyglobby

SuperchupuDev136.5mMIT0.2.15TypeScript support: included

A fast and minimal alternative to globby and fast-glob

glob, patterns, fast, implementation

readme

tinyglobby

npm version monthly downloads

A fast and minimal alternative to globby and fast-glob, meant to behave the same way.

Both globby and fast-glob present some behavior no other globbing lib has, which makes it hard to manually replace with something smaller and better.

This library uses only two subdependencies, compared to globby's 23 and fast-glob's 17.

Usage

import { glob, globSync } from 'tinyglobby';

await glob(['files/*.ts', '!**/*.d.ts'], { cwd: 'src' });
globSync('src/**/*.ts', { ignore: '**/*.d.ts' });

Documentation

Visit https://superchupu.dev/tinyglobby to read the full documentation.

changelog

0.2.15

Added

  • Documentation page at https://superchupu.dev/tinyglobby, which also contains a library comparison page and migration guide.

    It's been a huge effort that took two months to make.

    Big thanks to outslept, 43081j and benmccann for helping out! ❤️

  • JSDoc to all functions and options based on the online documentation page

  • Benchmarks with help from 43081j and benmccann

  • braceExpansion option

  • extglob option
  • fs option
  • globstar option by benmccann
  • signal option

  • package.json export as tinyglobby/package.json

  • Ability to pass readonly types by TomerAberbach

  • Support for URLs in cwd option

Changed

  • Rewritten path processing algorithm leading to a huge performance increase in many cases with help from 43081j and benmccann

  • Deprecated using patterns inside the options object

  • Enabled trusted publishing using npm's OIDC support

Fixed

  • Negated bracket expressions i.e. [!abc]
  • Some patterns like +++ breaking the partial matcher

0.2.14

Fixed

  • Root path joining on windows with help from 43081j and btea
  • deep: 0 is no longer mistakenly interpreted as not set
  • Parent directories in patterns are now correctly normalized to cwd

Changed

0.2.13

Fixed

  • Performance of crawling / thanks to an upstream fdir fix by pralkarz
  • Path joining when crawling from / by benmccann
  • Paths no longer have their first character removed in some cases when crawling from /
  • Added compatibility with @types/picomatch 4.0.0

0.2.12

Fixed

  • Using .. inside ignore patterns could sometimes make the optimizer ignore parent directories

Changed

  • The debug option now logs skipped directories

0.2.11

I've opened a sponsorships page! Consider sponsoring at https://github.com/sponsors/SuperchupuDev if you'd like to support the development of this project. This is a huge release in a technical aspect that took many months to get right.

Added

  • New optimizer to avoid crawling directories with entries that will never match.

    This is a huge performance improvement and it should solve most if not all performance issues in the library.

    This has taken many months to figure out and implement and has gotten through three different implementations with the help and/or advice of many people, most from e18e:

  • Other performance improvements, such as early returning without patterns by bluwy and micro-optimizations by Torathion

  • debug option. Useful for development purposes

Fixed

  • Usage of escaped patterns with a cwd that partially matches the pattern
  • Unsupported usages of backslashes making the library really slow. It should be way faster now thanks to the new optimizer

0.2.10

Added

  • Re-enabled symlinks resolution. Big thanks to thecodrr for fixing the critical bug upstream

Fixed

  • Processing of absolute negative patterns
  • Negative ignore patterns are now not processed for consistency with fast-glob

0.2.9

Changed

  • Temporarily reverted resolution of symbolic links due to a critical bug. See #54 for more info

0.2.8

Fixed

  • Escaped symbols (i.e. "\\[") in the inferred common root producing empty matches

Changed

  • Improved the common root inference algorithm to optimize non-trailing ** patterns

0.2.7

Added

  • Support for providing patterns as a string
  • followSymbolicLinks option
  • escapePath utility function by @benmccann
  • isDynamicPattern utility function
  • convertPathToPattern utility function

Fixed

  • . as a pattern now works as expected
  • Globbing no longer returns an empty string when matching the root directory
  • Handling of escaped symbols in patterns

Changed

  • Relicensed the project to the MIT license
  • Disabled source maps on release builds for smaller bundle size
  • Improved the common root inference algorithm

0.2.6

Added

  • Full support for absolute paths as patterns
  • caseSensitiveMatch option

0.2.5

Fixed

  • Using a pattern that doesn't end with special characters with expandDirectories disabled no longer produces incorrect matches

0.2.4

Fixed

  • Using a pattern that can't infer a common root with absolute enabled no longer produces incorrect matches

0.2.3

Added

  • Support for leading ../ in patterns

Changed

  • A common root is now inferred from the patterns if possible to avoid unnecessary crawling

0.2.2

Added

  • Basic handling of absolute patterns

Fixed

  • Adding trailing slashes to the end of patterns no longer returns incorrect results
  • Matching directories without expandDirectories without a trailing slash now works correctly

0.2.1

Fixed

  • Using an empty array of patterns no longer acts as ['**/*']

Changed

  • Windows now uses forward slashes instead of backslashes
  • Modified ignore behavior to vastly improve performance when ignoring whole directories

0.2.0

BREAKING CHANGES

The library no longer sets dot to true internally by default. It now defaults it to false, just like globby and fast-glob.

You can configure this by using the new dot option.

Added

  • Support for specifying the patterns option as the first argument to better approach a drop-in globby replacement
await glob(['src/*.ts'], { ignore: ['_secret'] });

// you can still specify it in the options object
await glob({ patterns: ['src/*.ts'], ignore: ['_secret'] });
  • Support for non-absolute paths in cwd
  • dot option
  • deep option
  • onlyFiles option

0.1.2

Added

  • onlyDirectories option

0.1.1

Added

  • ignore option
  • expandDirectories option