tooling
tooling copied to clipboard
recursive filesystem operations api
We've got some feedback on the recursive rmdir API; see https://github.com/nodejs/node/issues/34278
Given that the recursive option is still experimental, we can still break it, if necessary. Note that the recursive option for mkdir is not marked experimental.
This may be a good topic for a deep-dive session as noted by @bengl in #73. Also, input on API design from @nodejs/fs would be helpful.
Questions include, but are not limited to:
- Do we want to add more granular options to
fs.rmdir? e.g.,allowRetries,force - Do we want to move the recursive functionality to a new method, or a new module entirely?
- Should POSIX alignment be a goal for the
fsmodule? Even if not, should we stay out of it anyway? fs.rmdirw/recursiveactually functions likerm -fif given a file instead of a directory. Should it do that?
Note: It does not sound like outright removal of this functionality is being suggested anywhere.
It's pretty clear to me, anyway, that the current API is a product of various constraints, and not necessarily technical ones...
I commented in the meeting that much usage of these api's probably comes from a handful of fs wrapper libraries. To follow up on those, here are the most popular ones I know of:
- https://github.com/jprichardson/node-fs-extra
- I learned from this investigation that
fs-extraactually wrapsgraceful-fs(see below)
- I learned from this investigation that
- https://github.com/isaacs/node-graceful-fs
- I didn't find any direct coupling to the recursive apis, but I am new to this source so I could have missed it
- https://github.com/sindresorhus/make-dir
- It uses the recursive option in here. No evidence to me that this would break.