A Node.js module that adds missing file system methods and promise support to the native fs module.
fs-extra is a Node.js module that enhances the native file system (`fs`) module with additional methods and promise support. It provides commonly needed operations like recursive directory copying, removal, and creation that aren't available in standard Node.js, solving the problem of having to install multiple separate file system utilities.
Node.js developers who need robust file system operations beyond what the native `fs` module provides, particularly those working with file manipulation, build tools, or CLI applications.
Developers choose fs-extra because it consolidates functionality from multiple popular packages into a single, well-maintained module with consistent APIs, promise support, and reliable error handling through graceful-fs integration.
Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides methods like copy(), remove(), and ensureDir() for recursive operations, eliminating the need for separate packages like mkdirp or rimraf.
All async methods return promises when callbacks aren't passed, enabling clean async/await patterns without extra promisification.
Integrates graceful-fs to prevent EMFILE errors under high concurrency, improving reliability for file-intensive applications.
Includes readJson() and writeJson() that automatically handle parsing and stringification, streamlining JSON file I/O.
Maintains all native fs methods, allowing it to replace fs seamlessly in CommonJS projects without code changes.
The fs-extra/esm import doesn't include native fs methods, requiring separate imports and complicating migration to ES modules.
walk() and walkSync() were removed in v2.0.0, forcing users to install additional packages like klaw for directory walking.
Adds overhead for projects that only need basic fs operations, as it bundles utilities that might go unused.
Sync versions provided can block the event loop, which may impact performance in I/O-heavy applications if misused.