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);