Class: EpubData

EpubData(bookopt)

Class to load data from epub file.

Needs JSZip.

Available as default export of the module.

Constructor

new EpubData(bookopt)
Parameters:
Name Type Attributes Description
book Book <optional>

Epub book created by epub.js

Members

manifest :Object

List of items mapping an id and a href.

Type:
  • Object
spine :Array.<SpineItemData>

List of Objects describing spine items.

Type:
toc :Object
Type:
  • Object
uniqueIdentifier :String

Book unique identifier.

Type:
  • String

Methods

load(file) → Promise
Parameters:
Name Type Description
file File

epub file

Returns:

Resolved when data is parsed.

Type
Promise
spineFromHref(href) → String

Get the spine root from an href.

Parameters:
Name Type Description
href String

Page href

Returns:

Path in spine or null.

Type
String
toString() → String

Return a JSON stringified version of book data

Returns:

book data

Type
String