更多详细信息可参考官方API文档 https://doc.deno.land/https/github.com/denoland/deno/releases/latest/download/lib.deno.d.ts#Deno.removeSync
Deno.removeSync(path, {recursive})
path
为要删除的地址- 参数配置里的
recursive
为boolean
类型- 当
recursive
设置为true
时候,即使path
路径下是非空目录,也会递归删除掉目录里的所有内容。
- 当
Deno.removeSync('./assets/hello/world', {recursive: false})
Deno.remove(path, {recursive})
path
为要删除的地址- 参数配置里的
recursive
为boolean
类型- 当
recursive
设置为true
时候,即使path
路径下是非空目录,也会递归删除掉目录里的所有内容。 返回一个Promise
对象,回调为空void
- 当
async function main() {
await Deno.remove('./assets/hello/world', {recursive: false});
}
main();