@b-reader/epub
TypeScript icon, indicating that this package has built-in type declarations

0.3.5 • Public • Published

epubjs

how to use

pnpm i @b-reader/epub

import { Epub } from '@b-reader/epub'

const epub = new Epub(bookConfig.path)

declare class Epub {
  constructor(bookPath: string)
  private config
  private fullPath
  bookPath: string
  /**
     * 元数据
     */
  metadata?: MetaData
  /**
     * 资源
     */
  manifest?: Manifest[]
  /**
     * 书脊
     */
  spine?: Spine[]
  /**
     * 首页
     */
  guide?: Guide[]
  /**
     * 目录
     */
  private toc
  nva: Nav[]
  content: any[]
  cover?: string
  private usezip
  private usexml
  private rootFile?
  parse(): Promise<void>
  getSpines(): Spine[]
  getToc(): TocMeta
  getNva(): Nav[]
  getCover(): Promise<string>
  getContent(id?: string): Promise<any[]>
  getFile(path: string, type?: BufferEncoding): Promise<string>
  unzip(path: string): Promise<void>
  private parseConent
  private traverseImages
  private updateImageToBase64
  private parseGuide
  private parseToc
  private parseMetadata
  private getContentAndParse
  private parseXml
}

Readme

Keywords

none

Package Sidebar

Install

npm i @b-reader/epub

Weekly Downloads

3

Version

0.3.5

License

ISC

Unpacked Size

47.3 kB

Total Files

13

Last publish

Collaborators

  • baicie2