From 4278ea9df9d47b81ccb94856b32132d587450ed0 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sat, 22 Aug 2026 13:01:19 -0400 Subject: [PATCH] Added delete --- package.json | 2 +- src/manager.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 608a248..c0af0ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/zim-utils", - "version": "0.1.4", + "version": "0.1.5", "description": "Native, dependency-light ZIM archive reader/searcher and Kiwix catalog downloader for Node.js", "author": "Zak Timson", "license": "MIT", diff --git a/src/manager.js b/src/manager.js index 43549ea..c0f2256 100644 --- a/src/manager.js +++ b/src/manager.js @@ -86,6 +86,12 @@ export class ZimManager { return zimCatalog(search, opts); } + async delete(fileOrName) { + const file = await this.#resolveFile(fileOrName); + await fs.promises.unlink(file); + return {file, status: 'deleted'}; + } + /** Checks whether a local ZIM has a newer version in the catalog, without downloading. */ async isOutdated(file) { const meta = await this.#readMeta(file);