Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive fs.rmdir / fs.rm #806

Closed
RyanZim opened this issue Jun 3, 2020 · 3 comments · Fixed by #882
Closed

Recursive fs.rmdir / fs.rm #806

RyanZim opened this issue Jun 3, 2020 · 3 comments · Fixed by #882

Comments

@RyanZim
Copy link
Collaborator

RyanZim commented Jun 3, 2020

Node core has added an experimental recursive option to fs.rmdir in nodejs/node#29168; first released in v12.10.0.

Docs: https://nodejs.org/api/fs.html#fs_fs_rmdir_path_options_callback

I'm hesitant to use this as long as it's experimental in Node core, but just opening an issue to track this.

@RyanZim
Copy link
Collaborator Author

RyanZim commented Oct 17, 2020

This is no longer experimental in v14.13.1: nodejs/node#35171 However, in response to nodejs/node#34278, the loose rimraf-like behavior that swallows errors and deletes directories is deprecated.

Instead, an fs.rm method with recursive and force options has been added in v14.14.0: nodejs/node#35494

Docs: https://nodejs.org/api/fs.html#fs_fs_rm_path_options_callback

I don't think it's wise to use recursive fs.rmdir, given that the behavior we want is deprecated. However, we should consider using fs.rm where possible.

Also, potentially consider removing fse.remove when fs.rm is present on all supported Node versions.

@RyanZim RyanZim added this to the 10.0.0 milestone Oct 17, 2020
@RyanZim RyanZim changed the title Recursive fs.rmdir Recursive fs.rmdir / fs.rm Oct 17, 2020
This was referenced Oct 17, 2020
@fregante
Copy link

the behavior we want is deprecated

Is it? It's just no longer the default. From what I see it's still there with force: true

@RyanZim
Copy link
Collaborator Author

RyanZim commented Nov 23, 2020

@fregante It's the behavior on fs.rmdir that's deprecated. fs.rm with force: true indeed is what we want, and that's not deprecated.

RyanZim added a commit that referenced this issue Apr 2, 2021
Fixes #806

Technically a breaking change since this removes the undocumented
ability to pass options to remove*()
RyanZim added a commit that referenced this issue Apr 8, 2021
Fixes #806

Technically a breaking change since this removes the undocumented
ability to pass options to remove*()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants