npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

json-to-epub

v1.1.2

Published

generate epub file from config

Downloads

253

Readme

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: //)