![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
fs
that avoids Error: EMFILE, too many open files
.As of version 0.4.0, Filequeue
supports Node 0.10.x, and as of version 0.5.0, it has basic Streams support.
Filequeue
was born out of my encounter with Error: EMFILE, too many open files
, which occurs when you try to open too many files at once on your system. Due to Node's asynchronous nature, if you perform a lot of fs.readFile
or similar operations in quick succession, you can easily hit your system's maxfiles
limit, usually set to 256 on a dev box.
Filequeue
creates a replacement for fs
, that I use as fq
with many of the same operations. However, it keeps track of how many files are open at once, and queues them if there are too many.
Through NPM
$ npm install filequeue
or using Git
$ git clone git://github.com/treygriffith/filequeue.git node_modules/filequeue/
var FileQueue = require('filequeue');
var fq = new FileQueue(100);
// additional instances will attempt to use the same instance (and therefore the same maxfiles)
var FileQueue2 = require('filequeue');
var fq2 = new FileQueue2(100);
console.log(fq === fq2); // => true
// you can force a new instance of filequeue with the `newQueue` parameter
var fq3 = new FileQueue(100, true);
console.log(fq === fq3); // => false
fs
methods for(var i=0; i<1000; i++) {
fq.readFile('/somefile.txt', {encoding: 'utf8'}, function(err, somefile) {
console.log("data from somefile.txt without crashing!", somefile);
});
}
Adding a new fs
method is simple, just add it to the methods.js
file following the conventions therein.
Pull requests to add other fs methods with tests exercising them are welcome.
FAQs
Drop-in Replacement for fs to prevent too many open files
The npm package filequeue receives a total of 330 weekly downloads. As such, filequeue popularity was classified as not popular.
We found that filequeue 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.