
Security News
minimatch Patches 3 High-Severity ReDoS Vulnerabilities
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.
fs-iterator
Advanced tools
A file system iterator with filter and asyncIterator iterafaces. Supports Node 0.10 and above
A file system iterator with filter and asyncIterator interfaces
Entries are of the format:
Promise
const Iterator = require('fs-iterator');
// traverse skipping .git folders
const iterator = new Iterator(__dirname, { filter: (entry: Entry): boolean => { return entry.stats.isDirectory() && entry.basename === '.git'; } });
iterator.on('error', console.log); // log expected errors without stopping flow 'ENOENT', 'EPERM', 'EACCES', 'ELOOP'
let value = await iterator.next();
while(!value.done) {
/* do something */
value = await iterator.next();
}
// using forEach with concurrency
const iterator2 = new Iterator(__dirname, { error: (err) => { return true; /* filter errors */ }});
const done = await iterator2.forEach((entry: Entry): undefined => { /* do something */ }, { concurrency: 1024 })
Callback
const Iterator = require('fs-iterator');
// traverse skipping .git folders
const iterator = new Iterator(__dirname, { filter: (entry: Entry): boolean => { return entry.stats.isDirectory() && entry.basename === '.git'; }, error: (err) => { return true; /* filter errors */ } });
iterator.forEach((entry: Entry): undefined => { /* do something */ }, { concurrency: 1024 }, (err, done) => {})
Iterator Options:
function(entry, callback). (default: false)forEach Options:
function(entry, callback) (default: false)FAQs
A file system iterator with filter and asyncIterator iterafaces. Supports Node 0.8 and above
We found that fs-iterator demonstrated a healthy version release cadence and project activity because the last version was released less than 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
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.

Research
/Security News
Socket uncovered 26 malicious npm packages tied to North Korea's Contagious Interview campaign, retrieving a live 9-module infostealer and RAT from the adversary's C2.

Research
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.