Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

epub-generator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epub-generator

Generate simple EPUB books with simple API in Node.js.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

epub-generator

Generate simple EPUB books with simple API in Node.js.

API

EpubGenerator = require('epub-generator')

EpubGenerator( options )

Create and return an generator. The generator is also a stream. You can pipe it to another stream (e.g. the stream returned by fs.createWriteStream). You need to listen to writableStream's events to get the generation status, such as drain, error, finish, etc.

Options (all optional):

  • uuid an identifier of the book, will generate one if not given
  • title the book's title, default to blank
  • language language of the book, will try to detect system's default language or set to "en" if not given
  • date the modification date, default to the current date
  • author author of the book
  • description some description
  • rights rights information
  • cover the cover image path, add the image using methods below

generator.add( path, data, meta )

Add data as a file in epub bundle. The data can be a string, buffer, or stream. path is the file's path in epub bundle.

Hint: you can use XHTML, CSS and common images in epub bundle.

Meta (all optional):

  • mimetype the mimetype to override the default mimetype
  • toc whether this file should be added to TOC (table of contents)
  • title the title, used in TOC

generator.end( callback )

Finish adding data. The callback is added to the finish event of the stream.

LICENSE

MIT

FAQs

Package last updated on 27 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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