Accenpt kiwix server URL and patched local zim icon to be dataURL
Publish Library / Build NPM Project (push) Successful in 15s
Publish Library / Tag Version (push) Successful in 10s

This commit is contained in:
2026-08-24 21:06:23 -04:00
parent 7d85031181
commit cab2571160
3 changed files with 35 additions and 27 deletions
+6 -4
View File
@@ -13,13 +13,15 @@ export class ZimManager {
server;
#ownsServer;
/** @param {{catalog?: string, server?: KiwixServer, port?: number, host?: string, binDir?: string}} [opts]
* server: reuse an existing KiwixServer; if omitted, one is created (not yet started) and exposed via `.server` for reuse elsewhere. */
constructor(dir, {catalog = CATALOG_URL, server, port, host, binDir} = {}) {
/** @param {{catalog?: string, server?: KiwixServer, port?: number, host?: string, binDir?: string, url?: string}} [opts]
* server: reuse an existing KiwixServer instance directly.
* url: attach to an already-running kiwix-serve by address instead (e.g. started elsewhere in your codebase
* with no shared reference) - mutually exclusive with `server`, ignored if `server` is given. */
constructor(dir, {catalog = CATALOG_URL, server, port, host, binDir, url} = {}) {
this.#catalogUrl = catalog;
this.#dir = dir;
this.#ownsServer = !server;
this.server = server ?? new KiwixServer(dir, {port, host, binDir});
this.server = server ?? new KiwixServer(dir, {port, host, binDir, url});
}
/** The KiwixServer backing this manager - reuse it directly for content/search access, or pass into another ZimManager. */