API Reference

graceful-fs

Drop-in fs replacement that handles EMFILE and other errors gracefully with retries.

Official Documentation ↗
CompatibilityThis documentation covers version v4.2.11. Check the official docs for the latest API surface.

Installation

npmnpm install graceful-fs
pnpmpnpm add graceful-fs

Methods

graceful-fs is drop-in fs replacement that handles EMFILE and other errors gracefully with retries.

Key Features

Installation

npm install graceful-fs

Usage

Errors

The following points are quoted verbatim from the official documentation. 来源:https://cdn.jsdelivr.net/gh/isaacs/node-graceful-fs@latest/README.md · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:50:04.854Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.

FAQ

Is graceful-fs cross-platform?
Yes, graceful-fs works on Windows, macOS, and Linux, normalizing paths and permission modes.
Does graceful-fs handle EMFILE errors?
Yes, graceful-fs gracefully retries on too many open files, avoiding EMFILE crashes.
Are operations atomic?
Atomic variants write to a temp file then rename, preventing partial reads during concurrent writes.