1. License
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”
MIT allows use in paid and closed-source products.
github.com/jprichardson/node-fs-extra/blob/master/LICENSE2. Maintained
github.com/jprichardson/node-fs-extra3. Used by agents' projects
Dependency in 64 public GitHub projects set up for AI coding agents that we scanned (1.0%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error
What fs-extra does
fs-extra is a free library for Node.js programs that work with files. It adds the everyday steps the built-in file module lacks, such as copying a whole folder, making nested folders, deleting a folder with everything in it, and saving settings files. You use it in place of the built-in module, so existing code keeps working.
What people build with it
Start a project from a template folder
Your setup script copies a starter folder with all its subfolders into a new project, skipping files you do not want.
Save settings into a new folder
Your app writes a settings or results file into a folder that may not exist yet; the folder is created on the way.
Clear the build folder before a build
Before each build your script empties the output folder but keeps the folder itself, so old files never ship by mistake.
Move finished uploads to storage
After an upload is checked, your server moves the file from a temporary folder to its final place, even on another disk.
Delete temporary work folders
Your tool removes its scratch folder with everything inside when a job ends, and does not fail if it is already gone.
Write files an AI agent generates Idea
Your agent writes many generated files into new nested folders; one call per file creates the folders and saves the text.
fs-extra popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How fs-extra is used
- fs-extra is a dependency in 64 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.3% of the 4,867 JavaScript/TypeScript ones), #22 of 408 in utilities.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 169; those are left out of every share on this page.
- Projects that use it most often also use chalk (39.1%), Vitest (53.1%), tsx (42.2%).
By coding agent
Often used with
More about fs-extra
Alternatives
fs-extra This page
Pick rimraf when all you need is to delete folders, also from an npm script on any system.
Pick ShellJS when you want Unix-style commands like cp -r, rm -rf, sed and grep inside a Node.js script.
Pick write-file-atomic when a half-written file after a crash would hurt, for example a settings file.
Get started
Tell your AI assistant
“Use the npm package fs-extra (pin fs-extra@11.4.1, Node.js 14.14+) for file work in this Node.js script: emptyDir the dist folder, copy the template folder into it, then outputJson the build info; use await and catch errors.”
Add fs-extra to your Node.js project.
npm install fs-extraFrom github.com/jprichardson/node-fs-extra/blob/master/README.md
Load it instead of the built-in fs; every method returns a promise when you pass no callback.
const fs = require('fs-extra')From github.com/jprichardson/node-fs-extra/blob/master/README.md
In an ES module project, import the extra methods from fs-extra/esm, or import the default from fs-extra.
import { readFileSync } from 'fs' import { readFile } from 'fs/promises' import { outputFile, outputFileSync } from 'fs-extra/esm'From github.com/jprichardson/node-fs-extra/blob/master/README.md
Mistakes to avoid
The fs-extra/esm entry does not carry the built-in fs methods.
Since version 11 the package only exposes its main entry and fs-extra/esm; deep paths throw.
With overwrite off and the target present, the copy silently does nothing.
Copying a folder copies its contents into the destination, not the folder itself.
The old top-level constants are not exported on Node.js 24 and newer.
Questions
Do I still need the built-in fs module?
No. All fs methods are attached to fs-extra, so one import covers both, except in the fs-extra/esm entry.
Does it work with async and await?
Yes. Async methods return a promise when you pass no callback; the sync versions throw on errors.
Can it watch a folder for changes?
No. The README recommends chokidar for watching files and folders.
Where did walk() go?
It was removed in version 2.0.0; the README points to the separate klaw and klaw-sync packages.
Are there TypeScript types?
Not in the package; the README points to the community types on DefinitelyTyped (@types/fs-extra).