{"repo":"jprichardson/node-fs-extra","free":true,"listed":false,"github":"https://github.com/jprichardson/node-fs-extra","clone":"git clone https://github.com/jprichardson/node-fs-extra.git","description":"Node.js: extra methods for the fs object like copy(), remove(), mkdirs()","language":"JavaScript","stars":9598,"topics":["javascript","nodejs","filesystem","move","copy","remove","delete"],"license":"MIT","category":"dev-tools","readme_excerpt":"Node.js: fs-extra ================= fs-extra adds file system methods that aren't included in the native fs module and adds promise support to the fs methods. It also uses graceful-fs to prevent EMFILE errors. It should be a drop in replacement for fs . Why? ---- I got tired of including mkdirp , rimraf , and ncp in most of my projects. Installation ------------ npm install fs-extra Usage ----- CommonJS fs-extra is a drop in replacement for native fs . All methods in fs are attached to fs-extra . All fs methods return promises if the callback isn't passed. You don't ever need to include the original fs module again: you can now do this: or if you prefer to make it clear that you're using fs-extra and not fs , you may want to name your fs variable fse like so: you can also keep both, but it's redundant: NOTE: The deprecated constants fs.F OK , fs.R OK , fs.W OK , & fs.X OK are not exported on Node.js v24.0.0+; please use their fs.constants equivalents. ESM There is also an fs-extra/esm import, that supports both default and named exports. However, note that fs methods are not included in fs-extra/esm ; you still need to import fs and/or fs/promises separately: Default exports are supported: but you probably want to just use regular fs-extra instead of fs-extra/esm for default exports: Sync vs Async vs Async/Await ------------- Most methods are async by default. All async methods will return a promise if the callback isn't passed. Sync methods on the other hand will throw if an","default_branch":null,"files":null,"tree":[],"storefront":"/r/jprichardson","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jprichardson/node-fs-extra/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}