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

graceful-fs

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graceful-fs - npm Package Compare versions

Comparing version 4.2.9 to 4.2.10

27

graceful-fs.js

@@ -194,2 +194,3 @@ var fs = require('fs')

fs.readdir = readdir
var noReaddirOptionVersions = /^v[0-5]\./
function readdir (path, options, cb) {

@@ -199,8 +200,26 @@ if (typeof options === 'function')

var go$readdir = noReaddirOptionVersions.test(process.version)
? function go$readdir (path, options, cb, startTime) {
return fs$readdir(path, fs$readdirCallback(
path, options, cb, startTime
))
}
: function go$readdir (path, options, cb, startTime) {
return fs$readdir(path, options, fs$readdirCallback(
path, options, cb, startTime
))
}
return go$readdir(path, options, cb)
function go$readdir (path, options, cb, startTime) {
return fs$readdir(path, options, function (err, files) {
function fs$readdirCallback (path, options, cb, startTime) {
return function (err, files) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()])
enqueue([
go$readdir,
[path, options, cb],
err,
startTime || Date.now(),
Date.now()
])
else {

@@ -213,3 +232,3 @@ if (files && files.sort)

}
})
}
}

@@ -216,0 +235,0 @@ }

2

package.json
{
"name": "graceful-fs",
"description": "A drop-in replacement for fs, making various improvements.",
"version": "4.2.9",
"version": "4.2.10",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

@@ -74,3 +74,3 @@ var constants = require('constants')

// if lchmod/lchown do not exist, then make them no-ops
if (!fs.lchmod) {
if (fs.chmod && !fs.lchmod) {
fs.lchmod = function (path, mode, cb) {

@@ -81,3 +81,3 @@ if (cb) process.nextTick(cb)

}
if (!fs.lchown) {
if (fs.chown && !fs.lchown) {
fs.lchown = function (path, uid, gid, cb) {

@@ -99,28 +99,34 @@ if (cb) process.nextTick(cb)

if (platform === "win32") {
fs.rename = (function (fs$rename) { return function (from, to, cb) {
var start = Date.now()
var backoff = 0;
fs$rename(from, to, function CB (er) {
if (er
&& (er.code === "EACCES" || er.code === "EPERM")
&& Date.now() - start < 60000) {
setTimeout(function() {
fs.stat(to, function (stater, st) {
if (stater && stater.code === "ENOENT")
fs$rename(from, to, CB);
else
cb(er)
})
}, backoff)
if (backoff < 100)
backoff += 10;
return;
}
if (cb) cb(er)
})
}})(fs.rename)
fs.rename = typeof fs.rename !== 'function' ? fs.rename
: (function (fs$rename) {
function rename (from, to, cb) {
var start = Date.now()
var backoff = 0;
fs$rename(from, to, function CB (er) {
if (er
&& (er.code === "EACCES" || er.code === "EPERM")
&& Date.now() - start < 60000) {
setTimeout(function() {
fs.stat(to, function (stater, st) {
if (stater && stater.code === "ENOENT")
fs$rename(from, to, CB);
else
cb(er)
})
}, backoff)
if (backoff < 100)
backoff += 10;
return;
}
if (cb) cb(er)
})
}
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
return rename
})(fs.rename)
}
// if read() returns EAGAIN, then just try it again.
fs.read = (function (fs$read) {
fs.read = typeof fs.read !== 'function' ? fs.read
: (function (fs$read) {
function read (fd, buffer, offset, length, position, callback_) {

@@ -146,3 +152,4 @@ var callback

fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
: (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
var eagCounter = 0

@@ -206,3 +213,3 @@ while (true) {

function patchLutimes (fs) {
if (constants.hasOwnProperty("O_SYMLINK")) {
if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
fs.lutimes = function (path, at, mt, cb) {

@@ -241,3 +248,3 @@ fs.open(path, constants.O_SYMLINK, function (er, fd) {

} else {
} else if (fs.futimes) {
fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }

@@ -244,0 +251,0 @@ fs.lutimesSync = function () {}

Sorry, the diff of this file is not supported yet

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