UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

21 lines (17 loc) 638 B
'use strict'; const node_fs = require('node:fs'); const assertValidFileOrDirectoryPath = require('./assertValidFileOrDirectoryPath-BMbgA-eI.cjs'); var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); const removeSync = /* @__PURE__ */ __name((path, options = {}) => { assertValidFileOrDirectoryPath(path); try { node_fs.unlinkSync(path); } catch { } try { node_fs.rmSync(path, { force: true, maxRetries: options?.maxRetries, recursive: true, retryDelay: options?.retryDelay }); } catch { } }, "removeSync"); module.exports = removeSync;