tinyglobby
v0.2.6
Published
A fast and minimal alternative to globby and fast-glob
Downloads
1,817,873
Maintainers
Readme
tinyglobby
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, unlike 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'] });
Options
patterns
: An array of glob patterns to search for. Defaults to['**/*']
.ignore
: An array of glob patterns to ignore.cwd
: The current working directory in which to search. Defaults toprocess.cwd()
.absolute
: Whether to return absolute paths. Defaults tofalse
.dot
: Whether to allow entries starting with a dot. Defaults tofalse
.deep
: Maximum depth of a directory. Defaults toInfinity
.caseSensitiveMatch
: Whether to match in case-sensitive mode. Defaults totrue
.expandDirectories
: Whether to expand directories. Disable to best matchfast-glob
. Defaults totrue
.onlyDirectories
: Enable to only return directories. DisablesonlyFiles
if set. Defaults tofalse
.onlyFiles
: Enable to only return files. Defaults totrue
.
Used by
tinyglobby
is downloaded many times by projects all around the world. Here's a list of notable projects that use it:
vitest
tsup
nuxt
vite-plugin-pwa
unocss
vitepress
pkg.pr.new
- Your own project? Open an issue if you feel like this list is incomplete.