Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-02-04 04:41:31 +0300
committerRebecca Turner <me@re-becca.org>2016-02-04 04:54:48 +0300
commit8a3c80c4fd3d82fe937f30bc7cbd3dee51a8a893 (patch)
tree693e85d1dc79f58ef11c1dadf9f64518b037323b /node_modules/graceful-fs
parent21b927182514a0ff6d9f34480bfc39f72e3e9f8c (diff)
graceful-fs@4.1.3
Fix a bug where close wasn't getting patched. Credit: @isaacs
Diffstat (limited to 'node_modules/graceful-fs')
-rw-r--r--node_modules/graceful-fs/README.md17
-rw-r--r--node_modules/graceful-fs/graceful-fs.js2
-rw-r--r--node_modules/graceful-fs/package.json142
3 files changed, 121 insertions, 40 deletions
diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md
index 13a2e8605..d920aaac9 100644
--- a/node_modules/graceful-fs/README.md
+++ b/node_modules/graceful-fs/README.md
@@ -34,3 +34,20 @@ var fs = require('graceful-fs')
// now go and do stuff with it...
fs.readFileSync('some-file-or-whatever')
```
+
+## Global Patching
+
+If you want to patch the global fs module (or any other fs-like
+module) you can do this:
+
+```javascript
+// Make sure to read the caveat below.
+var realFs = require('fs')
+var gracefulFs = require('graceful-fs')
+gracefulFs.gracefulify(realFs)
+```
+
+This should only ever be done at the top-level application layer, in
+order to delay on EMFILE errors from any fs-using dependencies. You
+should **not** do this in a library, because it can cause unexpected
+delays in other parts of the program.
diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js
index fe3b17cb6..9bf803e68 100644
--- a/node_modules/graceful-fs/graceful-fs.js
+++ b/node_modules/graceful-fs/graceful-fs.js
@@ -33,6 +33,7 @@ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) {
// retry() whenever a close happens *anywhere* in the program.
// This is essential when multiple graceful-fs instances are
// in play at the same time.
+module.exports.close =
fs.close = (function (fs$close) { return function (fd, cb) {
return fs$close.call(fs, fd, function (err) {
if (!err)
@@ -43,6 +44,7 @@ fs.close = (function (fs$close) { return function (fd, cb) {
})
}})(fs.close)
+module.exports.closeSync =
fs.closeSync = (function (fs$closeSync) { return function (fd) {
// Note that graceful-fs also retries when fs.closeSync() fails.
// Looks like a bug to me, although it's probably a harmless one.
diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json
index 629ec7f8d..f8fc8a0eb 100644
--- a/node_modules/graceful-fs/package.json
+++ b/node_modules/graceful-fs/package.json
@@ -1,42 +1,77 @@
{
- "name": "graceful-fs",
- "description": "A drop-in replacement for fs, making various improvements.",
- "version": "4.1.2",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/isaacs/node-graceful-fs.git"
- },
- "main": "graceful-fs.js",
- "engines": {
- "node": ">=0.4.0"
+ "_args": [
+ [
+ "graceful-fs@~4.1.2",
+ "/Users/rebecca/code/npm"
+ ]
+ ],
+ "_from": "graceful-fs@>=4.1.2 <4.2.0",
+ "_id": "graceful-fs@4.1.3",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/graceful-fs",
+ "_nodeVersion": "4.0.0",
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/graceful-fs-4.1.3.tgz_1454449326495_0.943017533281818"
},
- "directories": {
- "test": "test"
+ "_npmUser": {
+ "email": "i@izs.me",
+ "name": "isaacs"
},
- "scripts": {
- "test": "node test.js | tap -"
+ "_npmVersion": "3.7.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "graceful-fs",
+ "raw": "graceful-fs@~4.1.2",
+ "rawSpec": "~4.1.2",
+ "scope": null,
+ "spec": ">=4.1.2 <4.2.0",
+ "type": "range"
},
- "keywords": [
- "fs",
- "module",
- "reading",
- "retry",
- "retries",
- "queue",
- "error",
- "errors",
- "handling",
- "EMFILE",
- "EAGAIN",
- "EINVAL",
- "EPERM",
- "EACCESS"
+ "_requiredBy": [
+ "/",
+ "/fs-vacuum",
+ "/fs-write-stream-atomic",
+ "/fstream",
+ "/node-gyp",
+ "/npm-registry-client",
+ "/read-cmd-shim",
+ "/read-installed",
+ "/read-package-json",
+ "/readdir-scoped-modules",
+ "/sha",
+ "/standard/standard-engine/eslint/file-entry-cache/flat-cache",
+ "/standard/standard-engine/eslint/file-entry-cache/flat-cache/read-json-sync",
+ "/standard/standard-format/esformatter-jsx/babel-core/regenerator/commoner",
+ "/tap/nyc/read-pkg/load-json-file",
+ "/tap/nyc/read-pkg/path-type",
+ "/write-file-atomic"
],
- "license": "ISC",
+ "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz",
+ "_shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c",
+ "_shrinkwrap": null,
+ "_spec": "graceful-fs@~4.1.2",
+ "_where": "/Users/rebecca/code/npm",
+ "bugs": {
+ "url": "https://github.com/isaacs/node-graceful-fs/issues"
+ },
+ "dependencies": {},
+ "description": "A drop-in replacement for fs, making various improvements.",
"devDependencies": {
"mkdirp": "^0.5.0",
"rimraf": "^2.2.8",
- "tap": "^1.2.0"
+ "tap": "^5.4.2"
+ },
+ "directories": {
+ "test": "test"
+ },
+ "dist": {
+ "shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c",
+ "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz"
+ },
+ "engines": {
+ "node": ">=0.4.0"
},
"files": [
"fs.js",
@@ -44,14 +79,41 @@
"legacy-streams.js",
"polyfills.js"
],
- "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over [fs module](http://api.nodejs.org/fs.html)\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## USAGE\n\n```javascript\n// use just like fs\nvar fs = require('graceful-fs')\n\n// now go and do stuff with it...\nfs.readFileSync('some-file-or-whatever')\n```\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/isaacs/node-graceful-fs/issues"
- },
+ "gitHead": "694c56f3aed4aee62d6df169be123d3984f61b85",
"homepage": "https://github.com/isaacs/node-graceful-fs#readme",
- "_id": "graceful-fs@4.1.2",
- "_shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37",
- "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz",
- "_from": "graceful-fs@>=4.1.2 <4.2.0"
+ "keywords": [
+ "EACCESS",
+ "EAGAIN",
+ "EINVAL",
+ "EMFILE",
+ "EPERM",
+ "error",
+ "errors",
+ "fs",
+ "handling",
+ "module",
+ "queue",
+ "reading",
+ "retries",
+ "retry"
+ ],
+ "license": "ISC",
+ "main": "graceful-fs.js",
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "name": "graceful-fs",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/isaacs/node-graceful-fs.git"
+ },
+ "scripts": {
+ "test": "node test.js | tap -"
+ },
+ "version": "4.1.3"
}