Initialize and parse an EPUB file
masterTo use the library, instantiate the EPub class with a file path and call await epub.parse() before attempting to access any content.
Constructor Options:
pathToFile: The file path to the EPUB file.imageWebRoot(Optional): Prefix for image URLs. Defaults to/images/. If set to/images/, an internal URL like/images/IMG_ID/IMG_FILENAMEcan be used withgetImageby using theIMG_ID.chapterWebRoot(Optional): Prefix for chapter URLs. Defaults to/links/.
import EPub from "epub";
const epub = new EPub(pathToFile, {
imageWebRoot: '/images/',
chapterWebRoot: '/links/'
});
await epub.parse();