
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
read-dir-files
Advanced tools

Module for recursively (and non-recursively) reading all files in a directory.
npm install read-dir-files
var readDirFiles = require('read-dir-files');
readDirFiles.list('directory', function (err, filenames) {
if (err) return console.dir(err);
console.dir(filenames);
});
readDirFiles.read('directory', function (err, files) {
if (err) return console.dir(err);
console.dir(files);
});
Parameters:
dir Directory to read files fromencoding Files encoding. Optional.recursive Recurse into subdirectories? Optional, default true.callback Callback. Optional.Asynchronously reads all files from dir and returns them to the callback
in form:
{
dir: {
file0: <Buffer ...>,
file1: <Buffer ...>,
sub: {
file0: <Buffer ...>
}
}
}
If you pass it the encoding, instead of buffers you'll get strings.
Parameters:
dir Directory to read filenames fromoptions Files encoding. Optional.
options.recursive Recurses subdirectories.options.normalize Normalizes filenames.recursive Recurse into subdirectories? Optional, default true.callback Callback. Optional.Asynchronously reads all filenames from dir and returns them to the callback
in form:
[
'dir',
'file0',
'file1'
]
FAQs
Recursively read files from a directory
The npm package read-dir-files receives a total of 1,301 weekly downloads. As such, read-dir-files popularity was classified as popular.
We found that read-dir-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.