When using Node.js, I can choose between fs unlink method and fs-extra remove method to delete files and folders. Are there any specific use cases when to use which one or did anyone experience any performance benefits from using one over the other?
Asked
Active
Viewed 1,113 times
1 Answers
2
fs.unlink()
is built in to node. fs-extra.remove()
is available from a userland package. I haven't personally used fs-extra
, but from the description on its repo, it sounds like it's meant to be a convenience package.
Why?
I got tired of including
mkdirp
,rimraf
, andncp
in most of my projects.
It makes no claims about having improved performance, so it seems unlikely that it would perform better than the built in package.