Skip to content
0

katanakit-js / useRemoveDir

Function: useRemoveDir() ​

ts
function useRemoveDir(path, options?): Promise<FilesystemResult<string>>;

Defined in: src/infrastructure/filesystem/filesystem.service.ts:497

Removes a directory tree. Recursive by default; force: false surfaces ENOENT instead of ignoring missing paths.

Parameters ​

ParameterTypeDescription
pathstringDirectory path to remove.
options?{ force?: boolean; recursive?: boolean; }recursive (default true) and force (default false).
options.force?boolean-
options.recursive?boolean-

Returns ​

Promise<FilesystemResult<string>>

Safe Result with the removed path.

Example ​

ts
await useRemoveDir("data/cache");

Released under the MIT License.