Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Replace fs.rmdir with fs.rm #5667

Closed
trivikr opened this issue Aug 14, 2024 · 1 comment
Closed

Replace fs.rmdir with fs.rm #5667

trivikr opened this issue Aug 14, 2024 · 1 comment

Comments

@trivikr
Copy link

trivikr commented Aug 14, 2024

Is your request related to a problem? Please describe.

This project uses fs.rmdir with { recursive: true } which has been runtime deprecated since Node.js v16.0.0.

Example code

import fs from "fs-extra";

const dir = "test";
await fs.mkdir(dir);
await fs.rmdir("test", { recursive: true });

Output

(node:93995) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)

Describe the solution you'd like

Replace fs.rmdir with fs.rm API call

Example code which does not thrown runtime warning

import fs from "fs-extra";

const dir = "test";
await fs.mkdir(dir);
await fs.rm("test", { recursive: true });
@trivikr trivikr changed the title Replace fs.rmdir to fs.rm Replace fs.rmdir with fs.rm Aug 14, 2024
facebook-github-bot pushed a commit that referenced this issue Aug 20, 2024
Summary:
reported in gh issue
#5667

Reviewed By: nikoant

Differential Revision: D61539207

fbshipit-source-id: 7f816cefa4981ff2c57fb04a483a98617f96d132
@antonk52
Copy link
Contributor

Closed by
b819119

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants