graceful-fs
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12075
34