UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

19 lines (16 loc) 616 B
import { unlink, rm } from 'node:fs/promises'; import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-BWWgA1wj.mjs'; var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); const remove = /* @__PURE__ */ __name(async (path, options = {}) => { assertValidFileOrDirectoryPath(path); try { await unlink(path); } catch { } try { await rm(path, { force: true, maxRetries: options?.maxRetries, recursive: true, retryDelay: options?.retryDelay }); } catch { } }, "remove"); export { remove as default };