Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vow-fs

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vow-fs - npm Package Compare versions

Comparing version 0.1.13 to 0.2.0

lib/queue.js

54

lib/fs.js

@@ -9,6 +9,8 @@ /**

*
* @version 0.1.13
* @version 0.2.0
*/
var Vow = require('vow'),
Queue = require('./queue'),
openFilesQueue = new Queue(),
fs = require('fs'),

@@ -35,23 +37,25 @@ path = require('path'),

emfileTimeout = 1,
emfileFixWrapper = function(method) {
var wrapper = function() {
var callArgs = arguments;
return method.apply(vfs, callArgs).then(
function(res) {
emfileTimeout = Math.max(1, emfileTimeout / 2);
return res;
},
function(err) {
if(err.code === 'EMFILE') {
emfileTimeout++;
return Vow.delay(null, emfileTimeout).then(function() {
return wrapper.apply(vfs, callArgs);
emfileFixWrapper = function(method, weight) {
var wrapper = function() {
var callArgs = arguments;
return openFilesQueue.enqueue(function() {
return method.apply(vfs, callArgs).then(
function(res) {
emfileTimeout = Math.max(1, emfileTimeout / 2);
return res;
},
function(err) {
if(err.code === 'EMFILE') {
emfileTimeout++;
return Vow.delay(null, emfileTimeout).then(function() {
return wrapper.apply(vfs, callArgs);
});
}
else {
throw err;
}
});
}
else {
throw err;
}
});
};
return wrapper;
}, weight);
};
return wrapper;
},

@@ -130,3 +134,3 @@ undef;

});
}),
}, 2),

@@ -341,3 +345,9 @@ /**

});
},
options : function(opts) {
if(typeof opts.openFileLimit !== 'undefined') {
openFilesQueue.setMaxWeight(opts.openFileLimit);
}
}
};
{
"name" : "vow-fs",
"version" : "0.1.13",
"version" : "0.2.0",
"description" : "File I/O by Vow",

@@ -20,6 +20,6 @@ "homepage" : "https://github.com/dfilatov/vow-fs",

"peerDependencies": {
"vow" : ">= 0.1.x"
"vow" : ">= 0.3.9"
},
"devDependencies": {
"vow" : ">= 0.1.x",
"vow" : ">= 0.3.9",
"nodeunit" : "",

@@ -26,0 +26,0 @@ "istanbul" : ""

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc