UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

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