summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/graceful-fs/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/graceful-fs/README.md')
-rw-r--r--deps/npm/node_modules/graceful-fs/README.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/deps/npm/node_modules/graceful-fs/README.md b/deps/npm/node_modules/graceful-fs/README.md
index 13a2e86050..d920aaac9e 100644
--- a/deps/npm/node_modules/graceful-fs/README.md
+++ b/deps/npm/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.