This repository has been archived on 2019-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
epub/example.js

27 lines
603 B
JavaScript
Raw Normal View History

2011-06-12 19:04:40 +00:00
var EPub = require("./epub");
2011-06-13 11:33:53 +00:00
var epub = new EPub("tasuja.epub", "tere", "vana");
2011-06-12 19:04:40 +00:00
epub.on("error", function(err){
console.log("ERROR\n-----");
throw err;
});
epub.on("end", function(err){
console.log("PARSED\n-----");
console.log(epub.metadata);
console.log(epub.manifest);
console.log(epub.spine);
console.log(epub.toc);
epub.getChapter("item259", function(err, data){
console.log(err || data);
});
epub.getImage("item262", function(err, data, mimeType){
console.log(err || data);
console.log(mimeType)
});
});
epub.parse();