From 582bbac00cc0131819843b05716434f612739992 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Fri, 5 Mar 2021 07:48:27 -0500 Subject: [PATCH] Clarify README.md regarding sync methods --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5273a50..82d6e4d 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,19 @@ the directory. var fs = require('graceful-fs') // now go and do stuff with it... -fs.readFileSync('some-file-or-whatever') +fs.readFile('some-file-or-whatever', (err, data) => { + // Do stuff here. +}) ``` +## Sync methods + +This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync +methods. If you use sync methods which open file descriptors then you are +responsible for dealing with any errors. + +This is a known limitation, not a bug. + ## Global Patching If you want to patch the global fs module (or any other fs-like