

All async methods will return a promise if the callback isn't passed. You can also keep both, but it's redundant: const fs = require('fs') To name your fs variable fse like so: const fse = require('fs-extra') Or if you prefer to make it clear that you're using fs-extra and not fs, you may want You can now do this: const fs = require('fs-extra') You don't ever need to include the original fs module again: const fs = require('fs') // this is no longer necessary All fs methods return promises if the callback isn't passed. All methods in fs are attached to fs-extra.

Installation npm install fs-extraįs-extra is a drop in replacement for native fs. I got tired of including mkdirp, rimraf, and ncp in most of my projects.

It should be a drop in replacement for fs.

It also uses graceful-fs to prevent EMFILE errors. Fs-extra adds file system methods that aren't included in the native fs module and adds promise support to the fs methods.
