Skip to content

Tankōbon / main/services/cbz-archive / CbzArchive

Class: CbzArchive ​

Defined in: main/services/cbz-archive.ts:13

A .cbz (ZIP) comic, read entry by entry with node-stream-zip (the file stays open until close()).

Implements ​

Properties ​

fileCount ​

readonly fileCount: number

Defined in: main/services/cbz-archive.ts:25

Total entries in the archive (not just image pages).

Implementation of ​

ComicArchive.fileCount


pages ​

readonly pages: readonly string[]

Defined in: main/services/cbz-archive.ts:24

Image entry names, sorted in reading order.

Implementation of ​

ComicArchive.pages


path ​

readonly path: string

Defined in: main/services/cbz-archive.ts:23

Implementation of ​

ComicArchive.path

Methods ​

close() ​

close(): Promise<void>

Defined in: main/services/cbz-archive.ts:72

Waits for in-flight reads to settle, then closes the ZIP file.

Returns ​

Promise<void>

Implementation of ​

ComicArchive.close


readPage() ​

readPage(index): Promise<ComicPage>

Defined in: main/services/cbz-archive.ts:49

Reads page index (0-based); throws a RangeError when out of range, or once close() has begun.

Parameters ​

index ​

number

Returns ​

Promise<ComicPage>

Implementation of ​

ComicArchive.readPage


open() ​

static open(filePath): Promise<CbzArchive>

Defined in: main/services/cbz-archive.ts:31

Opens and indexes the archive; throws (after closing it) when it holds no image.

Parameters ​

filePath ​

string

Returns ​

Promise<CbzArchive>