Description
epub.js is a JavaScript library for rendering ePub books in the browser, across many devices. It gives you an interface for common e-book functions such as rendering, persistence and pagination, so you do not need to build a dedicated reading app or plugin. The library relies on the EPUB standard, which describes an unzipped EPUB 3 as a collection of HTML5 files, CSS and media with a schema for the table of contents and a manifest that lets the whole book be cached. It has two render methods. The default manager shows one section at a time, and the continuous manager shows as many sections as fill the screen and preloads the next one off screen, giving smooth scrolling on mobile and desktop but at a cost in performance. The flow can be set to auto, paginated or scrolled. Scripted content inside an ePub is disabled by default because it runs in a sandboxed iframe, and the README says trusted books can have it switched on, which makes the sandbox less secure. It also advises sanitising ePub content on the server. API documentation is on epubjs.org, with a Markdown copy in the repository. The library is released under a permissive BSD licence and is developed on GitHub.…
Highlights
- Render ePub books in the browser
- Paginated and continuous views
- Cacheable manifest and table of contents
- Scripts in books disabled by default
- Permissive BSD licence
Ratings & Reviews
No ratings yet
Be the first to rate Epub.js.
People also visit
Epub.js FAQ
What is epub.js?
A JavaScript library that renders ePub books inside a web page.
Who is it for?
Developers who want to show ePub books in a web app, without building a reader from scratch.
Is it free?
Yes. It has a permissive BSD licence.
Does it handle pages?
Yes. It offers a paginated flow, and a continuous manager that scrolls through sections.
Do scripts in a book run?
Not by default. Scripted content is sandboxed and disabled, and you can enable it for books you trust.
Where is the API documentation?
On epubjs.org, with a Markdown copy in the repository.
Do I need JSZip?
Only if you load archived .epub files, in which case JSZip must be included before epub.js.
What are the best Epub.js alternatives?
Popular alternatives to Epub.js include Flow, Epubcheck and EPub-InkPlate. See all Epub.js alternatives

