要递归删除目录及其所有内容,请使用Documentation Index
Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
node:fs/promises 中的 rm。这相当于在 JavaScript 中运行 rm -rf。
这些选项配置删除行为:
recursive: true- 删除子目录及其内容force: true- 如果目录不存在,不抛出错误
force 来确保目录存在:
更多文件系统操作,请参见 文档 > API > 文件系统。