Gathering detailed insights and metrics for readdir-cluster
Gathering detailed insights and metrics for readdir-cluster
Gathering detailed insights and metrics for readdir-cluster
Gathering detailed insights and metrics for readdir-cluster
Use multiple CPU cores via clusters for the fastest way to read nested directories and their stats
npm install readdir-cluster
Typescript
Module System
Min. Node Version
Node Version
NPM Version
75
Supply Chain
99.4
Quality
76.2
Maintenance
100
Vulnerability
100
License
TypeScript (90.1%)
JavaScript (9.9%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
10 Stars
77 Commits
2 Forks
1 Watchers
2 Branches
2 Contributors
Updated on May 27, 2024
Latest Version
6.0.0
Package Id
readdir-cluster@6.0.0
Unpacked Size
96.90 kB
Size
19.43 kB
File Count
37
NPM Version
10.2.3
Node Version
20.10.0
Published on
Dec 30, 2023
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
Create a cluster of workers to iterate through the filesystem
1import readdirCluster, { Stat } from 'readdir-cluster' 2 3// note that Stat is not the same as fs.Stats as it has functions removed, as it needed to be serialisable 4function iterator(path: string, filename: string, stat: Stat) { 5 // skip directories and files that start with . 6 if (filename[0] === '.') return false 7 // do not recurse into directories 8 if (stat.directory) return false 9} 10 11const paths = await readdirCluster({ directory: '.', iterator }) 12console.log(paths)
Running readdir-cluster .
returns 7388 files in 500ms
Running readdir
with recursive: true
returns 7388 files in 100ms
1import { readdir } from 'fs' 2readdir('.', { recursive: true }, (err, files) => { 3 if (err) console.error(err) 4 else if (files.length) process.stdout.write(files.join('\n') + '\n') 5})
Running fdir returns 6480 files in 100ms
1import { fdir } from 'fdir' 2const api = new fdir().withBasePath().crawl(process.argv[2]) 3api.withPromise().then((files) => { 4 if (files.length) process.stdout.write(files.join('\n') + '\n') 5})
As such, you should probably use readdir
with recursive: true
or fdir
instead. As for why this package exists, readdir-cluster was created in 2005, recursive was added to Node.js in 2023, and fdir was created in 2020. That said, there are several issues that could potentially improve readdir-cluster performance.
npm install --global readdir-cluster
readdir-cluster
npm install --save readdir-cluster
npx readdir-cluster
import pkg from ('readdir-cluster')
const pkg = require('readdir-cluster').default
This package is published with the following editions:
readdir-cluster
aliases readdir-cluster/index.cjs
which uses the Editions Autoloader to automatically select the correct edition for the consumer's environmentreaddir-cluster/source/index.ts
is TypeScript source code with Import for modulesreaddir-cluster/edition-es2022/index.js
is TypeScript compiled against ES2022 for Node.js 14 || 16 || 18 || 20 || 21 with Require for modulesreaddir-cluster/edition-es2017/index.js
is TypeScript compiled against ES2017 for Node.js 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesreaddir-cluster/edition-es2015/index.js
is TypeScript compiled against ES2015 for Node.js 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesreaddir-cluster/edition-es5/index.js
is TypeScript compiled against ES5 for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesreaddir-cluster/edition-es2017-esm/index.js
is TypeScript compiled against ES2017 for Node.js 12 || 14 || 16 || 18 || 20 || 21 with Import for modulesreaddir-cluster/edition-types/index.d.ts
is TypeScript compiled Types with Import for modulesDiscover the release history by heading on over to the HISTORY.md
file.
Discover how to contribute via the CONTRIBUTING.md
file.
Unless stated otherwise all works are:
and licensed under:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/13 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
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