Gathering detailed insights and metrics for readdir-glob
Gathering detailed insights and metrics for readdir-glob
Gathering detailed insights and metrics for readdir-glob
Gathering detailed insights and metrics for readdir-glob
@types/readdir-glob
TypeScript definitions for readdir-glob
tiny-readdir-glob
A simple promisified recursive readdir function, with support for globs.
recrawl-sync
[](https://www.npmjs.com/package/recrawl-sync) [](https://github.com/aleclarson/recrawl/actions/workflows/release.yml)
tiny-readdir-glob-gitignore
A simple promisified recursive readdir function, with support for globs and .gitignore files.
Recursive fs.readdir with streaming API and glob filtering.
npm install readdir-glob
Typescript
Module System
Node Version
NPM Version
JavaScript (74.89%)
TypeScript (19.9%)
Shell (5.21%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
6 Stars
23 Commits
2 Watchers
3 Branches
1 Contributors
Updated on Oct 28, 2024
Latest Version
2.0.1
Package Id
readdir-glob@2.0.1
Unpacked Size
67.56 kB
Size
13.42 kB
File Count
16
NPM Version
10.5.0
Node Version
20.12.1
Published on
Oct 28, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Recursive version of fs.readdir wih stream API and glob filtering.
Uses the minimatch
library to do its matching.
Requirements:
Compared to glob
, readdir-glob
is memory efficient: no matter the file system size, or the number of returned files, the memory usage is constant.
The CPU cost is proportional to the number of files in root
folder, minus the number files in options.skip
folders.
Advice: For better performances use options.skip
to restrict the search as much as possible.
Install with npm
npm i readdir-glob
1const readdirGlob = require('readdir-glob'); 2const globber = readdirGlob('.', {pattern: '**/*.js'}); 3globber.on('match', match => { 4 // m.relative: relative path of the matched file 5 // m.absolute: absolute path of the matched file 6 // m.stat: stat of the matched file (only if stat:true option is used) 7}); 8globber.on('error', err => { 9 console.error('fatal error', err); 10}); 11globber.on('end', (m) => { 12 console.log('done'); 13});
root
{String}
Path to be read recursively, default: '.'
options
{Object}
Options, default: {}
Returns a EventEmitter reading given root recursively.
options
: The options object passed in.paused
: Boolean which is set to true when calling pause()
.aborted
Boolean which is set to true when calling abort()
. There is no way at this time to continue a glob search after aborting.match
: Every time a match is found, this is emitted with the specific thing that matched.end
: When the matching is finished, this is emitted with all the matches found.error
: Emitted when an unexpected error is encountered.pause()
: Temporarily stop the searchresume()
: Resume the searchabort()
: Stop the search foreverpattern
: Glob pattern or Array of Glob patterns to match the found files with. A file has to match at least one of the provided patterns to be returned.ignore
: Glob pattern or Array of Glob patterns to exclude matches. If a file or a folder matches at least one of the provided patterns, it's not returned. It doesn't prevent files from folder content to be returned. Note: ignore
patterns are always in dot:true
mode.skip
: Glob pattern or Array of Glob patterns to exclude folders. If a folder matches one of the provided patterns, it's not returned, and it's not explored: this prevents any of its children to be returned. Note: skip
patterns are always in dot:true
mode.mark
: Add a /
character to directory matches.stat
: Set to true to stat all results. This reduces performance.silent
: When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. Set the silent
option to true to suppress these warnings.nodir
: Do not match directories, only files.follow
: Follow symlinked directories. Note that requires to stat all results, and so reduces performance.The following options apply only if pattern
option is set, and are forwarded to minimatch
:
dot
: Allow pattern
to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot.noglobstar
: Disable **
matching against multiple folder names.nocase
: Perform a case-insensitive match. Note: on case-insensitive filesystems, non-magic patterns will match by default, since stat
and readdir
will not raise errors.matchBase
: Perform a basename-only match if the pattern does not contain any slash characters. That is, *.js
would be treated as equivalent to **/*.js
, matching all js files in all directories.Unit-test set is based on node-glob tests.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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 More