fs-extra

Drop-in replacement for Node's fs module adding copy, remove, mkdirs, and JSON helpers with native promise support.

Library
npm
v11.4.1
9,594 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
59 /100 Fair
Development Activity 52
Maintenance 20
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 85
Code Quality 85
Innovation 88
Learning Curve 85

fs-extra is one of the most depended-upon packages in the npm ecosystem, adding the file-system methods Node’s built-in fs module leaves out — recursive copy, recursive remove, mkdir -p semantics, empty-directory helpers, symlink/hardlink creation, and direct JSON read/write. Every fs method is re-exported and promisified via universalify, so callers can mix callbacks, promises, and async/await without a separate wrapper library.

Because it clones and extends the native fs object rather than replacing it, teams can swap require('fs') for require('fs-extra') with zero API changes elsewhere in a codebase, then opt into the extra methods as needed. Backed by graceful-fs to avoid EMFILE errors under heavy concurrent file access, it has been a stable dependency of build tools, CLIs, and test harnesses for over a decade.

What You Get

  • Recursive copy/copySync with filters, overwrite control, and timestamp preservation
  • Recursive remove/removeSync (rm -rf equivalent) and emptyDir/emptyDirSync
  • ensureDir/mkdirs (mkdir -p semantics) plus ensureFile, ensureLink, ensureSymlink
  • Direct JSON helpers: readJson, writeJson, outputJson and their sync variants
  • move/moveSync for cross-device-safe renames, and outputFile for write-with-mkdir
  • Every native fs method re-exported and promisified via universalify, plus an ESM build at fs-extra/esm

Common Use Cases

  • Build tools and CLIs that need to copy or clean template/output directories recursively
  • Test suites that scaffold and tear down temporary fixture directories between runs
  • Config and cache tooling that reads/writes JSON files without manual JSON.parse/stringify + mkdir boilerplate
  • Deployment and packaging scripts that move build artifacts between directories across devices

Under The Hood

Architecture fs-extra organizes each capability as its own directory under lib/ (copy, remove, mkdirs, move, json, ensure, empty, output-file, path-exists, plus a shared fs and util), each exporting an async/sync pair that lib/index.js merges into a single namespace via object spread; lib/esm.mjs hand-maps the same functions to named exports for the fs-extra/esm entry point. The fs submodule (lib/fs/index.js) filters Node’s fs method list to what’s actually available on the running Node version, clones it onto the export object, then wraps each method with universalify.fromCallback so native fs behavior is preserved while gaining promise support — this is the mechanism that makes fs-extra a genuine drop-in replacement rather than a parallel API. Tech Stack The runtime dependency surface is deliberately tiny: graceful-fs (queues and retries fs calls to avoid EMFILE/EPERM under load), jsonfile (the JSON read/write engine readJson/writeJson delegate to), and universalify (the promise/callback duality helper used throughout). Pure JavaScript, no native bindings, engines.node >=14.14, and CommonJS-first with a hand-written ESM shim rather than a build step. Code Quality Nearly every lib/<feature> directory has a co-located __tests__ folder (visible under copy, remove, mkdirs, move, json, ensure, empty, fs, util, output-file, path-exists), run through mocha/nyc via npm run unit, plus a dedicated test.mjs for the ESM build and standard as the enforced lint/style config — there is no ambiguity about formatting since standard is non-configurable. Error handling favors explicit try/finally cleanup, visible in lib/util/utimes.js where a file descriptor is always closed even if futimes throws, with the original error preserved and rethrown rather than swallowed. API Design The public surface reads as an extension of fs rather than a competing library: sync methods keep the *Sync suffix Node uses, async methods return promises by default and accept an optional trailing callback for backward compatibility, and naming choices like remove/copy/mkdirs were deliberately chosen (per the README’s naming-rationale section) over inconsistent POSIX-style shorthand. Getting started requires no configuration beyond require('fs-extra') in place of require('fs'), which is close to zero boilerplate for the common case.

Used by 84 apps in this directory

Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 6 days ago
TypeScript
81%
AGPL 3.0

Postiz

Automation · Social Media

37,683

The agentic social media scheduler — AI-powered content creation, 33-platform posting, and team workflows, all self-hosted.

View details
92
Repo Health
70
Technical
63
Dependency
Built with
TypeScript 81%
JavaScript 11%
Updated 1 weeks ago
TypeScript
64%
AGPL 3.0

Puter

Developer Tools · File Storage

43,864

A self-hostable, web-based internet OS with desktop GUI, cloud storage, AI drivers, and a developer SDK — all running in your browser.

View details
88
Repo Health
88
Technical
67
Dependency
Built with
TypeScript 64%
JavaScript 33%
Updated 6 days ago
Python
99%
Apache 2.0

Rasa Open Source

AI Assistants · AI Development · Voice AI

21,353

Rasa Open Source is a Python machine learning framework for building contextual, multi-turn chatbots and voice assistants that understand natural language and maintain conversation state.

View details
62
Repo Health
78
Technical
63
Dependency
Built with
Python 99%
Updated 3 months ago
TypeScript
100%
AGPL 3.0

RSSHub

Automation · Social Media

46,631

Turn any website into an RSS feed — social media, streaming platforms, and niche sites all become subscribable in seconds.

View details
94
Repo Health
82
Technical
71
Dependency
Built with
TypeScript 100%
Updated 6 days ago
JavaScript
89%
GPL 3.0

Screenity

Productivity · Video Editors

18,806

Free, privacy-first Chrome screen recorder with real-time annotation, AI camera blur, and a built-in video editor — no sign-in or limits required.

View details
74
Repo Health
62
Technical
70
Dependency
Built with
JavaScript 89%
Updated 1 weeks ago
TypeScript
61%
AGPL 3.0

Silex

Design Tools · No Code Platforms

3,015

Free, open-source visual website builder that exports clean HTML/CSS — no lock-in, no subscription, host anywhere

View details
89
Repo Health
68
Technical
67
Dependency
Built with
TypeScript 61%
Rust 15%
JavaScript 11%
Updated 1 weeks ago
TypeScript
83%
AGPL 3.0

Standard Notes

Note Taking

6,681

End-to-end encrypted notes and files — private by design, built to last, and fully self-hostable.

View details
89
Repo Health
83
Technical
68
Dependency
Built with
TypeScript 83%
JavaScript 14%
Updated 1 weeks ago
TypeScript
89%
Other

strapi

CMS

73,368

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
63
Dependency
Built with
TypeScript 89%
JavaScript 11%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers