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 May 20, 2024 via pnpm

recursive-readdir 2.2.3

Get an array of all files in a directory and subdirectories.
Package summary
Share
0
issues
2
licenses
4
MIT
1
ISC
Package created
7 Jan 2012
Version published
25 Oct 2022
Maintainers
2
Total deps
5
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
4 Packages, Including:
balanced-match@1.0.2
brace-expansion@1.1.11
concat-map@0.0.1
recursive-readdir@2.2.3

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
minimatch@3.1.2
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 recursive-readdir 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
minimatch3.1.211.66 kBISC
prod

Visualizations

Frequently Asked Questions

What does recursive-readdir do?

The recursive-readdir npm package is designed to list all files in a directory and its subdirectories recursively. This means it digs down into every level of directories, picking up files along the way, but doesn't list the directories themselves. It's worth noting that because recursive-readdir uses fs.readdir under the hood, the order of files inside the directories is not guaranteed.

How do you use recursive-readdir?

To use recursive-readdir in your JavaScript project, you'll first need to install the module. You do this by running npm install recursive-readdir. Once installed, you can import it into your JavaScript file using var recursive = require("recursive-readdir").

You can then call the recursive function providing the path of the directory you want to traverse as a string. The recursive function takes a callback as the second argument, which receives error and files arguments. Here's an example:

var recursive = require("recursive-readdir");

recursive("some/path", function (err, files) {
  console.log(files); // logs all files in 'some/path' directory and subdirectories
});

If there are certain files you want to ignore, you can pass these in as an array of strings as a second argument before the callback. For example:

var recursive = require("recursive-readdir");

recursive("some/path", ["foo.cs", "*.html"], function (err, files) {
  console.log(files); // logs all files except ones named 'foo.cs' or ending in '.html'
});

If you prefer to use promises instead of callbacks, recursive-readdir also supports this. You can simply omit the callback and a promise will be returned:

var recursive = require("recursive-readdir");

recursive("some/path").then(
  function(files) {
    console.log("files are", files);
  },
  function(error) {
    console.error("something exploded", error);
  }
);

Where are the recursive-readdir docs?

The entire documentation for the recursive-readdir package is found in its README on GitHub. This includes the package's details, information about installation, usage examples, and notes about its behavior. You can access the README directly on GitHub at git://github.com/jergason/recursive-readdir.git, where you'll find an extensive explanation of the package and its functionality.