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 1.2.0 to 1.2.1

17

package.json
{
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
"name": "graceful-fs",
"description": "fs monkey-patching to avoid EMFILE and other problems",
"version": "1.2.0",
"description": "A drop-in replacement for fs, making various improvements.",
"version": "1.2.1",
"repository": {

@@ -22,8 +22,17 @@ "type": "git",

"fs",
"EMFILE",
"module",
"reading",
"retry",
"retries",
"queue",
"error",
"errors",
"handling",
"monkeypatch"
"EMFILE",
"EAGAIN",
"EINVAL",
"EPERM",
"EACCESS"
],
"license": "BSD"
}

@@ -1,5 +0,33 @@

Just like node's `fs` module, but it does an incremental back-off when
EMFILE is encountered.
# graceful-fs
Useful in asynchronous situations where one needs to try to open lots
and lots of files.
graceful-fs functions as a drop-in replacement for the fs module,
making various improvements.
The improvements are meant to normalize behavior across different
platforms and environments, and to make filesystem access more
resilient to errors.
## Improvements over fs module
graceful-fs:
* keeps track of how many file descriptors are open, and by default
limits this to 1024. Any further requests to open a file are put in a
queue until new slots become available. If 1024 turns out to be too
much, it decreases the limit further.
* fixes `lchmod` for Node versions prior to 0.6.2.
* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
`lchown` if the user isn't root.
* makes `lchmod` and `lchown` become noops, if not available.
* retries reading a file if `read` results in EAGAIN error.
On Windows, it retries renaming a file for up to one second if `EACCESS`
or `EPERM` error occurs, likely because antivirus software has locked
the directory.
## Configuration
The maximum number of open file descriptors that graceful-fs manages may
be adjusted by setting `fs.MAX_OPEN` to a different number. The default
is 1024.
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