Skip to content

Tankōbon / main/services/cbr-archive / CbrArchive

Class: CbrArchive ​

Defined in: main/services/cbr-archive.ts:42

A .cbr (RAR) comic, read with node-unrar-js (unrar compiled to WebAssembly). The whole file is loaded in memory when opened.

Implements ​

Properties ​

fileCount ​

readonly fileCount: number

Defined in: main/services/cbr-archive.ts:46

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

Implementation of ​

ComicArchive.fileCount


pages ​

readonly pages: readonly string[]

Defined in: main/services/cbr-archive.ts:45

Image entry names, sorted in reading order.

Implementation of ​

ComicArchive.pages


path ​

readonly path: string

Defined in: main/services/cbr-archive.ts:44

Implementation of ​

ComicArchive.path

Methods ​

close() ​

close(): Promise<void>

Defined in: main/services/cbr-archive.ts:86

Nothing to release: the archive lives in memory.

Returns ​

Promise<void>

Implementation of ​

ComicArchive.close


readPage() ​

readPage(index): Promise<ComicPage>

Defined in: main/services/cbr-archive.ts:67

Extracts page index (0-based); throws a RangeError when out of range.

Parameters ​

index ​

number

Returns ​

Promise<ComicPage>

Implementation of ​

ComicArchive.readPage


open() ​

static open(filePath): Promise<CbrArchive>

Defined in: main/services/cbr-archive.ts:52

Reads and indexes the archive; throws when it holds no image.

Parameters ​

filePath ​

string

Returns ​

Promise<CbrArchive>