Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 8, 2024 via pnpm

readdirp 3.6.0

Recursive version of fs.readdir with streaming API.
Package summary
Share
0
issues
1
license
2
MIT
Package created
18 Jul 2012
Version published
14 Mar 2021
Maintainers
2
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
picomatch@2.3.1
readdirp@3.6.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of readdirp 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
picomatch2.3.123.72 kBMIT
prod

Visualizations

Frequently Asked Questions

What does readdirp do?

readdirp is a recursive version of fs.readdir, popular in the npm package ecosystem, which exposes both a streaming API and a promise API.

How do you use readdirp?

To use readdirp, you first need to install it via npm using the command npm install readdirp. Once installed, you can require it in your code with const readdirp = require('readdirp');.

There are several ways to use readdirp depending on your specific needs:

  • For example, you can use it with streams for small RAM & CPU footprint. Here is an example of using readdirp with streams and for-await:
for await (const entry of readdirp('.')) {
  const {path} = entry;
  console.log(`${JSON.stringify({path})}`);
}
  • Another way to use readdirp is through its Promise API, which uses more RAM and CPU than streams / for-await:
const files = await readdirp.promise('.');
console.log(files.map(file => file.path));
  • You can also use it with filters and specific options:
readdirp('test', {
  fileFilter: '*.js',
  directoryFilter: ['!.git', '!*modules'],
  type: 'files_directories',
  depth: 1
});

The above examples demonstrate basic usage for common cases, but readdirp provides a more complex API for further needs.

Where are the readdirp docs?

The detailed documentation for readdirp is in the GitHub package repository. Here you can find all details regarding the API and its options. Anything from basic package usage to advanced configurations can be found within these comprehensive docs. Ensure to check out the 'API' and 'options' sections specifically round out your understanding of the functionality offered by readdirp.