New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

epubstream

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epubstream - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

42

lib/epub.js

@@ -6,2 +6,3 @@ var stream = require('stream'),

zipstream = require('zipstream-contentment'),
async = require('async'),
ncx = require('./ncx'),

@@ -77,3 +78,11 @@ opf = require('./opf'),

Epub.prototype._addTOCFile = function(cover, next) {
var tocTemplate = fs.readFileSync(this.opts.tocTemplate, 'utf8'),
contents = stache.render(tocTemplate, {nav: this.opts.nav, cover: this.opts.cover});
this.addFile(contents, this.opts.tocFile, next);
};
Epub.prototype.finalize = function(callback) {
this.addFile(ncx(this.opts), this.opts.ncx, (function() {

@@ -84,18 +93,23 @@ var displayTemplate = fs.readFileSync(this.opts.displaytemplate, 'utf8');

this.addFile(ocf(this.opts), this.opts.ocf, (function() {
if(this.opts.cover) {
var covertemplate = fs.readFileSync(this.opts.covertemplate, 'utf8');
this.addFile(stache.render(covertemplate, this.opts), this.opts.coverpage, (function() {
var self = this;
var tocTemplate = fs.readFileSync(this.opts.tocTemplate, 'utf8');
this.addFile(stache.render(tocTemplate, {nav: this.opts.nav, cover: this.opts.cover}), this.opts.tocFile, (function(){
this._zip.finalize(callback);
}).bind(this));
async.series([
function addCover(next) {
if (self.opts.cover) {
var covertemplate = fs.readFileSync(self.opts.covertemplate, 'utf8');
return self.addFile(stache.render(covertemplate, self.opts), self.opts.coverpage, next);
}
}).bind(this));
} else {
var tocTemplate = fs.readFileSync(this.opts.tocTemplate, 'utf8');
this.addFile(stache.render(tocTemplate, {nav: this.opts.nav}), this.opts.tocFile, (function(){
this._zip.finalize(callback);
}).bind(this));
}
next();
},
function addTOC(next) {
if (self.opts.epubVersion == 'epup3') { return self._addTOCFile(null, next); }
next();
}
], function(err) {
self._zip.finalize(callback);
});
}).bind(this));

@@ -102,0 +116,0 @@ }).bind(this));

{
"name" : "epubstream",
"version" : "0.0.5",
"description" : "Epub",
"author": "Danny Amey <danny@dannyamey.com>",
"main": "./index.js",
"dependencies": {
"genx": "0.9.0",
"zipstream-contentment": "0.2.1",
"stache": "0.1.0"
},
"repository": {
"type": "git",
"url": "git://github.com/contentment/node-epubstream.git"
}
"name": "epubstream",
"version": "0.0.6",
"description": "Epub",
"author": "Danny Amey <danny@dannyamey.com>",
"main": "./index.js",
"dependencies": {
"genx": "0.9.0",
"zipstream-contentment": "0.2.1",
"stache": "0.1.0",
"async": "~0.2.5"
},
"repository": {
"type": "git",
"url": "git://github.com/contentment/node-epubstream.git"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc