1.1.2 • Published 8 months ago

json-to-epub v1.1.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
8 months ago

JSON to Epub

The library will read JSON files from folders and generate epub file.

Setup

Prepare folder with structure:

/
 manifest.js // content book manifest
 chapter1.json // any file name you want
 chapter2.json
 ...

run npx json-to-epub


manifest.js

module.exports = {
    title: "Book title",
    author: "Manh Lai",
    publisher: "sample publisher";
    output: "./",
    bookName: "sample.epub",
}
  • title: Title of the book
  • author: Name of the author for the book, string or array, eg. "Alice" or ["Alice", "Bob"]
  • publisher: Publisher name (optional)
  • cover: Book cover image (optional), File path (absolute path) or web url, eg. "http://abc.com/book-cover.jpg" or "/User/Alice/images/book-cover.jpg"
  • output Out put path (relative path)
  • bookName Out put file name

chapter2.json

{
    "title": "About the author",
    "author": "John Doe",
    "order": 1,
    "data": "<h2>Charles Lutwidge Dodgson</h2><div lang=\"en\">Better known by the pen name Lewis Carroll...</div>"
}
  • title: optional, Chapter title
  • author: optional, if each book author is different, you can fill it.
  • order: optional, determine chapter order. default, chapters are sorted by file name.
  • data: required, HTML String of the chapter content. image paths should be absolute path (should start with "http" or "https"), so that they could be downloaded. With the upgrade is possible to use local images (for this the path must start with file: //)
1.1.2

8 months ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.0

2 years ago