2 Commits
0.1.0 ... 0.1.2

Author SHA1 Message Date
c38f149733 Better pathing
All checks were successful
Publish Library / Build NPM Project (push) Successful in 9s
Publish Library / Tag Version (push) Successful in 9s
2026-08-22 10:22:32 -04:00
f5eaf7f764 Bump 0.1.1
All checks were successful
Publish Library / Build NPM Project (push) Successful in 9s
Publish Library / Tag Version (push) Successful in 53s
2026-08-20 11:38:59 -04:00
2 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@ztimson/zim-utils",
"version": "0.1.0",
"version": "0.1.2",
"description": "Native, dependency-light ZIM archive reader/searcher and Kiwix catalog downloader for Node.js",
"author": "Zak Timson",
"license": "MIT",
@@ -10,7 +10,7 @@
"type": "git",
"url": "https://git.zakscode.com/ztimson/zim-utils"
},
"main": "index.js",
"main": "src/index.js",
"dependencies": {
"@ztimson/utils": "^0.30.7",
"lzma1": "^0.3.0",

View File

@@ -73,8 +73,10 @@ export class ZimManager {
/** Resolves a file path or catalog `name` to a local file path. */
async #resolveFile(fileOrName) {
if (fs.existsSync(fileOrName)) return fileOrName;
const joined = path.join(this.#dir, fileOrName);
if (fs.existsSync(joined)) return joined;
const local = await this.list();
const match = local.find(l => l.meta?.name === fileOrName);
const match = local.find(l => l.meta?.name === fileOrName || path.basename(l.file) === fileOrName);
if (!match) throw new Error(`ZIM not found locally: ${fileOrName}`);
return match.file;
}