@thi.ng/file-io
Advanced tools
Comparing version 2.0.3 to 2.1.0
# Change Log | ||
- **Last updated**: 2024-04-20T14:42:45Z | ||
- **Last updated**: 2024-04-23T07:02:17Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,8 @@ | ||
## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/file-io@2.1.0) (2024-04-23) | ||
#### 🚀 Features | ||
- add deleteDir() ([06b4ffc](https://github.com/thi-ng/umbrella/commit/06b4ffc)) | ||
### [2.0.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/file-io@2.0.3) (2024-04-20) | ||
@@ -14,0 +20,0 @@ |
@@ -12,2 +12,11 @@ import type { ILogger } from "@thi.ng/logger"; | ||
export declare const deleteFile: (path: string, logger?: ILogger, dryRun?: boolean) => void; | ||
/** | ||
* Like {@link deleteFile}, but attempts to recursively remove an entire | ||
* directory at given path. | ||
* | ||
* @param path | ||
* @param logger | ||
* @param dryRun | ||
*/ | ||
export declare const deleteDir: (path: string, logger?: ILogger, dryRun?: boolean) => void; | ||
//# sourceMappingURL=delete.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { unlinkSync } from "node:fs"; | ||
import { rmSync, unlinkSync } from "node:fs"; | ||
const deleteFile = (path, logger, dryRun = false) => { | ||
@@ -8,4 +8,11 @@ logger && logger.info(`${dryRun ? "[dryrun] " : ""}deleting file: ${path}`); | ||
}; | ||
const deleteDir = (path, logger, dryRun = false) => { | ||
logger && logger.info(`${dryRun ? "[dryrun] " : ""}deleting file: ${path}`); | ||
if (dryRun) | ||
return; | ||
rmSync(path, { recursive: true, force: true }); | ||
}; | ||
export { | ||
deleteDir, | ||
deleteFile | ||
}; |
{ | ||
"name": "@thi.ng/file-io", | ||
"version": "2.0.3", | ||
"version": "2.1.0", | ||
"description": "Assorted file I/O utils (with logging support) for NodeJS/Bun", | ||
@@ -30,3 +30,3 @@ "type": "module", | ||
"build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts", | ||
"clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc", | ||
"clean": "bun ../../tools/src/clean-package.ts", | ||
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts", | ||
@@ -40,7 +40,7 @@ "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.11.0", | ||
"@thi.ng/checks": "^3.6.2", | ||
"@thi.ng/hex": "^2.3.44", | ||
"@thi.ng/logger": "^3.0.10", | ||
"@thi.ng/random": "^3.7.4" | ||
"@thi.ng/api": "^8.11.1", | ||
"@thi.ng/checks": "^3.6.3", | ||
"@thi.ng/hex": "^2.3.45", | ||
"@thi.ng/logger": "^3.0.11", | ||
"@thi.ng/random": "^3.7.5" | ||
}, | ||
@@ -50,3 +50,2 @@ "devDependencies": { | ||
"esbuild": "^0.20.2", | ||
"rimraf": "^5.0.5", | ||
"typedoc": "^0.25.12", | ||
@@ -130,3 +129,3 @@ "typescript": "^5.4.3" | ||
}, | ||
"gitHead": "8339d05ecc857e529c7325a9839c0063b89e728d\n" | ||
"gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42976
4
670
Updated@thi.ng/api@^8.11.1
Updated@thi.ng/checks@^3.6.3
Updated@thi.ng/hex@^2.3.45
Updated@thi.ng/logger@^3.0.11
Updated@thi.ng/random@^3.7.5