Build a web-based e-book reader that lets users load and read ePub files directly in the browser without installing anything
Add annotation support to an ePub reader by hooking into Epub.js chapter-load events to inject custom markup before the reader sees the text
Implement a paginated or infinite-scroll reading experience for digital books inside a web or hybrid app
JSZip must be loaded before epub.js, JavaScript inside ePub files is disabled by default for security and must be explicitly enabled.
Epub.js is a JavaScript library that lets you display ePub documents inside a web browser. ePub is a widely used format for digital books: it is essentially a bundle of HTML pages, images, and styling files packed together according to a standard schema. Epub.js reads that format and renders it as a readable experience directly on a web page, without requiring a dedicated app or browser plugin. The library provides methods for loading a book, rendering it into a specified area of the page, and controlling how the reader moves through the content. Two rendering modes are available: a default mode that shows one section of the book at a time, and a continuous mode that loads adjacent sections so the reader can scroll or swipe smoothly between pages. Page flow can be set to paginated, scrolled, or automatic based on the book's own settings. Epub.js includes a hooks system, which lets developers attach custom code to specific points in the rendering process. For example, a hook can run when a chapter is loaded into the page, allowing the developer to modify content or add annotations before the reader sees the text. The README notes that JavaScript embedded inside an ePub file is disabled by default, because scripts in a book file could pose a security risk. It can be enabled explicitly for trusted files by passing a configuration option, though the authors note this weakens the content sandbox. Using the library requires including JSZip (for handling compressed ePub archives) before epub.js. The built distribution file can be included directly from the repository's dist folder. Full API documentation is hosted at epubjs.org. The library is released under the BSD license.
← futurepress on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.