fdir
The fastest directory crawler & globbing alternative to glob, fast-glob, & tiny-glob. Crawls 1m files in < 1s
wildcard-match
A tiny and extremely fast library for compiling and matching basic glob patterns
totalist
A tiny (195B to 220B) utility to recursively list all (total) files in a directory
tiny-readdir-glob
A simple promisified recursive readdir function, with support for globs.
2
Tiny and extremely fast library to match files and folders using glob patterns.
"Globs" is the common name for a specific type of pattern used to match files and folders. It's the patterns you type when you do stuff like ls *.js
in your shell or put src/*
in a .gitignore
file. When used to match filenames, it's sometimes called a "wildcard".
npm install tiny-glob
ExtGlob
)const glob = require('tiny-glob'); (async function(){ let files = await glob('src/*/*.{js,md}'); // => [ ... ] array of matching files })();
Type: function
Returns: Array
Return array of matching files and folders
This function is async
and returns a promise.
Type: String
The glob pattern to match against.
OBS: Please only use forward-slashes in glob expressions. Even on windows
Type: String
Default: '.'
Change default working directory.
Type: Boolean
Default: false
Allow patterns to match filenames or directories that begin with a period (.
).
Type: Boolean
Default: false
Return matches as absolute paths.
Type: Boolean
Default: false
Skip directories and return matched files only.
Type: Boolean
Default: false
Flush the internal cache object.
Though Windows may use /
, \
, or \\
as path separators, you can only use forward-slashes (/
) when specifying glob expressions. Any back-slashes (\
) will be interpreted as escape characters instead of path separators.
This is common across many glob-based modules; see node-glob
for corroboration.
glob x 13,405 ops/sec Ā±1.80% (85 runs sampled)
fast-glob x 25,745 ops/sec Ā±2.76% (59 runs sampled)
tiny-glob x 102,658 ops/sec Ā±0.79% (91 runs sampled)
Fastest is tiny-glob
āāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāā
ā Name ā Mean time ā Ops/sec ā Diff ā
āāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāā¤
ā glob ā 0.00007459990597268128 ā 13,404.843 ā N/A ā
āāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāā¤
ā fast-glob ā 0.000038842529587611705 ā 25,744.976 ā 92.06% faster ā
āāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāā¤
ā tiny-glob ā 0.00000974110141018254 ā 102,657.796 ā 298.75% faster ā
āāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāā
Learn more about advanced globbing
MIT Ā© Terkel Gjervig
Score
Last Scanned on 2024-09-02
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More98.4
Supply Chain Risk
97.9
Quality
75.5
Maintenance
100
Vulnerability
854 Stars
113 Commits
26 Forks
11 Watching
8 Branches
10 Contributors
Updated on 08 Sept 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-25.6%
59,890
Compared to previous day
Last week
-3.1%
1,477,948
Compared to previous week
Last month
-8.8%
6,090,715
Compared to previous month
Last year
-32.4%
91,454,947
Compared to previous year