deno.land / std@0.91.0 / node / _fs / _fs_rmdir.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
type rmdirOptions = { maxRetries?: number; recursive?: boolean; retryDelay?: number;};
type rmdirCallback = (err?: Error) => void;
export function rmdir(path: string | URL, callback: rmdirCallback): void;export function rmdir( path: string | URL, options: rmdirOptions, callback: rmdirCallback,): void;export function rmdir( path: string | URL, optionsOrCallback: rmdirOptions | rmdirCallback, maybeCallback?: rmdirCallback,) { const callback = typeof optionsOrCallback === "function" ? optionsOrCallback : maybeCallback; const options = typeof optionsOrCallback === "object" ? optionsOrCallback : undefined;
if (!callback) throw new Error("No callback function supplied");
Deno.remove(path, { recursive: options?.recursive }) .then((_) => callback(), callback);}
export function rmdirSync(path: string | URL, options?: rmdirOptions) { Deno.removeSync(path, { recursive: options?.recursive });}
std

Version Info

Tagged at
3 years ago

External Dependencies

No external dependencies 🎉