Badass JavaScript

A showcase of awesome JavaScript that pushes the boundaries of what's possible on the web, by @devongovett.

Booktorious: A Client Side ePub Reader in JavaScript

June 16th 2010

Booktorious is a new proof of concept ePub reader in JavaScript by August Lilleaas.  It is 100% open source, and is based on several libraries, all written by August except js-inflate.

Reads the EPUB file format, providing an array DOM objects of the chapters in the book. It also converts all images in the book to data uris.
EPUB files are packaged as Zip files.
Zips are containers that can use many different compression formats. EPUB books use deflate (compression) and inflate (decompression). js-unzip itself doesn’t implement decompression, it justs tells what compression algorithm the Zip file is using.
My own DOM library. Call me crazy.
The JavaScript application framework I wrote. Unlike Cappuccino and Sproutcore, it doesn’t abstract away HTML and CSS. It’s not finished or production ready at all.
JavaScript templating engine with HTML-like synax. Used by Mediocre.

It only works in the latest browsers with the HTML5 FileReader API, so right now that is Firefox 3.6 and Chrome 6.  I tried reading The Adventures of Sherlock Holmes, as well as Through the Looking Glass which included images, and both rendered perfectly with good performance.

You can check out Booktorious here (be sure to use Firefox 3.6 or Chrome 6), and the code on Github.  Nice work!