{
 "kind": "tool",
 "slug": "fs-extra",
 "path": "tools/fs-extra/",
 "name": "fs-extra",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Utilities",
   "tools/utilities/"
  ]
 ],
 "lead": "Copy, move and clean folders in Node.js.",
 "chips": [
  {
   "label": "Utilities",
   "path": "tools/utilities/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install fs-extra"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/jprichardson/node-fs-extra"
  },
  {
   "label": "Website",
   "href": "https://github.com/jprichardson/node-fs-extra"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software",
   "note": "MIT allows use in paid and closed-source products.",
   "src": "https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 11, 2026",
   "note": "",
   "src": "https://github.com/jprichardson/node-fs-extra"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "64 projects",
   "status": "info",
   "sub": "#22 of 408 in its category",
   "note": "Dependency in 64 public GitHub projects set up for AI coding agents that we scanned (1.0%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What fs-extra does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Start a project from a template folder",
       "text": "Your setup script copies a starter folder with all its subfolders into a new project, skipping files you do not want.",
       "idea": false
      },
      {
       "title": "Save settings into a new folder",
       "text": "Your app writes a settings or results file into a folder that may not exist yet; the folder is created on the way.",
       "idea": false
      },
      {
       "title": "Clear the build folder before a build",
       "text": "Before each build your script empties the output folder but keeps the folder itself, so old files never ship by mistake.",
       "idea": false
      },
      {
       "title": "Move finished uploads to storage",
       "text": "After an upload is checked, your server moves the file from a temporary folder to its final place, even on another disk.",
       "idea": false
      },
      {
       "title": "Delete temporary work folders",
       "text": "Your tool removes its scratch folder with everything inside when a job ends, and does not fail if it is already gone.",
       "idea": false
      },
      {
       "title": "Write files an AI agent generates",
       "text": "Your agent writes many generated files into new nested folders; one call per file creates the folders and saves the text.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "fs-extra popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "72",
       "of": "/ 100",
       "l": "Gid Score, #298 overall"
      },
      {
       "n": "314M",
       "l": "downloads a week, npm"
      },
      {
       "n": "9,594",
       "l": "GitHub stars"
      },
      {
       "n": "64",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How fs-extra is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "40 projects, 1.2%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "33 projects, 1.1%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "26 projects, 1.1%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "16 projects, 3.4%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "6 projects, 2.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "5 projects, 1.5%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 39.1% of its projects",
       "v": "chalk",
       "path": "tools/chalk/"
      },
      {
       "l": "In 53.1% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 42.2% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 28.1% of its projects",
       "v": "glob",
       "path": "tools/glob/"
      },
      {
       "l": "In 28.1% of its projects",
       "v": "uuid",
       "path": "tools/uuid/"
      },
      {
       "l": "In 79.7% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 28.1% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      },
      {
       "l": "In 25.0% of its projects",
       "v": "cross-env",
       "path": "tools/cross-env/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about fs-extra",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "More in Utilities",
       "path": "tools/utilities/",
       "items": [
        {
         "text": "clsx",
         "path": "tools/clsx/"
        },
        {
         "text": "date-fns",
         "path": "tools/date-fns/"
        },
        {
         "text": "PyYAML",
         "path": "tools/pyyaml/"
        },
        {
         "text": "uuid",
         "path": "tools/uuid/"
        },
        {
         "text": "yaml",
         "path": "tools/yaml/"
        },
        {
         "text": "js-yaml",
         "path": "tools/js-yaml/"
        },
        {
         "text": "glob",
         "path": "tools/glob/"
        },
        {
         "text": "Lodash",
         "path": "tools/lodash/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "fs-extra",
       "me": true,
       "facts": [
        "MIT",
        "Gid 72",
        "314M/wk"
       ]
      },
      {
       "name": "rimraf",
       "why": "Pick rimraf when all you need is to delete folders, also from an npm script on any system.",
       "path": "tools/rimraf/",
       "facts": []
      },
      {
       "name": "ShellJS",
       "why": "Pick ShellJS when you want Unix-style commands like cp -r, rm -rf, sed and grep inside a Node.js script.",
       "path": "tools/shelljs/",
       "facts": []
      },
      {
       "name": "write-file-atomic",
       "why": "Pick write-file-atomic when a half-written file after a crash would hurt, for example a settings file.",
       "path": "tools/write-file-atomic/",
       "facts": []
      }
     ],
     "more": "Compare fs-extra with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "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."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add fs-extra to your Node.js project.",
       "code": "npm install fs-extra",
       "src": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md"
      },
      {
       "text": "Load it instead of the built-in fs; every method returns a promise when you pass no callback.",
       "code": "const fs = require('fs-extra')",
       "src": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md"
      },
      {
       "text": "In an ES module project, import the extra methods from fs-extra/esm, or import the default from fs-extra.",
       "code": "import { readFileSync } from 'fs'\nimport { readFile } from 'fs/promises'\nimport { outputFile, outputFileSync } from 'fs-extra/esm'\n",
       "src": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "import { readFileSync, copy } from 'fs-extra/esm'",
       "fix": "Import fs methods from 'fs' or 'fs/promises', and only the extra methods (copy, outputFile, ...) from 'fs-extra/esm'; or use import fs from 'fs-extra'",
       "why": "The fs-extra/esm entry does not carry the built-in fs methods."
      },
      {
       "dont": "require('fs-extra/lib/copy')",
       "fix": "require('fs-extra') and call fs.copy(...)",
       "why": "Since version 11 the package only exposes its main entry and fs-extra/esm; deep paths throw."
      },
      {
       "dont": "fs.copy(src, dest, { overwrite: false }) and assuming an existing file means an error",
       "fix": "{ overwrite: false, errorOnExist: true } when you need to know the copy was skipped",
       "why": "With overwrite off and the target present, the copy silently does nothing."
      },
      {
       "dont": "fs.copy('photos', 'backup') expecting backup/photos",
       "fix": "fs.copy('photos', 'backup/photos')",
       "why": "Copying a folder copies its contents into the destination, not the folder itself."
      },
      {
       "dont": "fs.access(file, fs.F_OK) on Node.js 24",
       "fix": "fs.access(file, fs.constants.F_OK)",
       "why": "The old top-level constants are not exported on Node.js 24 and newer."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Do I still need the built-in fs module?",
       "a": "No. All fs methods are attached to fs-extra, so one import covers both, except in the fs-extra/esm entry.",
       "evidence": {
        "url": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md",
        "quote": "fs-extra is a drop in replacement for native fs. All methods in fs are attached to fs-extra."
       }
      },
      {
       "q": "Does it work with async and await?",
       "a": "Yes. Async methods return a promise when you pass no callback; the sync versions throw on errors.",
       "evidence": {
        "url": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md",
        "quote": "All async methods will return a promise if the callback isn't passed."
       }
      },
      {
       "q": "Can it watch a folder for changes?",
       "a": "No. The README recommends chokidar for watching files and folders.",
       "evidence": {
        "url": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md",
        "quote": "If you want to watch for changes to files or directories, then you should use chokidar."
       }
      },
      {
       "q": "Where did walk() go?",
       "a": "It was removed in version 2.0.0; the README points to the separate klaw and klaw-sync packages.",
       "evidence": {
        "url": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md",
        "quote": "They were removed from fs-extra in v2.0.0."
       }
      },
      {
       "q": "Are there TypeScript types?",
       "a": "Not in the package; the README points to the community types on DefinitelyTyped (@types/fs-extra).",
       "evidence": {
        "url": "https://github.com/jprichardson/node-fs-extra/blob/master/README.md",
        "quote": "If you like TypeScript, you can use fs-extra with it:"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm fs-extra"
  ],
  [
   "Category",
   "Utilities"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "72.3"
  ],
  [
   "Rank in category",
   "#22 of 408"
  ],
  [
   "GitHub",
   "jprichardson/node-fs-extra"
  ],
  [
   "Last change",
   "Nov 11, 2026"
  ]
 ],
 "good": [
  "It needs Node.js 14.14 or newer and runs only in Node.js, not in a web page.",
  "Copying a folder copies what is inside it, not the folder itself: copying \"photos\" into \"backup\" puts the photos straight into \"backup\".",
  "With overwrite turned off, a copy onto an existing file silently does nothing unless you also ask for an error."
 ],
 "checked_line": "Read by AgentGid from 14 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/jprichardson.png"
}