
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
recursive-readdir-filter
Advanced tools
Get an array of all files in a directory and subdirectories. Supports filters.
#recursive-readdir-filter
This is a fork of https://github.com/jergason/recursive-readdir.
It adds support for filtering files and folders.
A simple Node module for recursively listing all files in a directory, or in any subdirectories.
It does not list directories themselves.
npm install recursive-readdir-filter
Just like recursive-readdir
var recursive-readdir = require('recursive-readdir-filter');
recursive-readdir('some/path', function (err, files) {
// Files is an array of filename
console.log(files);
});
But now with filters;
var options = {
filterDir: function (stats) {
return stats.name !== 'node_modules';
},
filterFile: function (stats) {
return stats.name.match(/\.js$/);
}
};
recursive-readdir('some/path', options, function (err, files) {
console.log(files);
});
Options are completly optional;
Both options must be a function. A Stats object is passed to them, but with some extra information added:
/Volumes/Home/foo.txt
.foo.txt
./Volumes/Home
.{
dev: 2114,
ino: 48064969,
mode: 33188,
nlink: 1,
uid: 85,
gid: 100,
rdev: 0,
size: 527,
blksize: 4096,
blocks: 8,
atime: Mon, 10 Oct 2011 23:24:11 GMT,
mtime: Mon, 10 Oct 2011 23:24:11 GMT,
ctime: Mon, 10 Oct 2011 23:24:11 GMT,
name: 'a',
path: '/Volumes/Home/Projects/recursive-readdir/test/testdir/a/a/'
folder: '/Volumes/Home/Projects/recursive-readdir/test/testdir/a/'
}
filterDir
Is run whenever a folder is found.
filterFile
Is run whenever a file is found.
FAQs
Get an array of all files in a directory and subdirectories. Supports filters.
The npm package recursive-readdir-filter receives a total of 3 weekly downloads. As such, recursive-readdir-filter popularity was classified as not popular.
We found that recursive-readdir-filter 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.