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 🙏

© 2026 – Pkg Stats / Ryan Hefner

epubify

v0.3.0

Published

Generate an ePub book from a simple plaintext descriptor.

Downloads

53

Readme

gen-epub-book.js Build Status Licence npm version

Generate an ePub book from a simple plaintext descriptor.

Manpage

Browserified bundles

Quickstart

Install via:

npm install -g epubify

Copy this somewhere:

Name: Simple ePub demonstration
Cover: cover.png

Image-Content: simple/chapter_image.png
Content: simple/ctnt.html

Author: nabijaczleweli
Date: 2017-02-08T15:30:18+01:00
Language: en-GB

Modify to your liking, then, assuming you put the file in "example/test.epupp" and want to write the result to "out/test.epub", run:

epubify example/test.epupp out/test.epub

For more detailed usage information and tag list, see the manpage, and for a full guide see the webpage.

Versions in other languages

The original in AWK.

A rewrite in Rust.

A rewrite in C++.

A rewrite in Scala.

Documentation

BookError

Extends Error

Generic book parsing error.

parse_descriptor(string_contents, relative_root)

Parse specified file content into a Book instance.

Parameters

  • string_contents string the content of the specified file
  • relative_root string

Returns Book

util.RFC3339_FORMAT

Format string to parse RFC3339 with moment.

Type: string

util.CHAPTER_TITLE_REGEX

Regex for extracting chapter titles.

Type: RegExp

util.file_exists(path)

Check whether a file with the specified path exists.

Parameters

  • path string The file for whose existence to check.

Returns boolean Whether the specified file exists.

util.string_content(content)

Get content of string-content, having provided the content of that string-content (yes).

Parameters

  • content string String data of that string content.

Returns string String content to include in e-book.

util.image_content_string(img_path)

Get img filler for image-content.

For full image string content one need do epubify.util.string_content(util.image_content_string(img_path)).

Parameters

  • img_path string Packed path of image.

Returns string Stringified <img> tag.

util.file_id(file_path)

Get e-book ID for the specified relative path.

Parameters

  • file_path string Pathname specified in "Content" key.

Returns string E-book ID to use for content.

util.file_packed_path(file_path)

Get packed e-book path for the specified relative path.

Parameters

  • file_path string Pathname specified in "Content" key.

Returns string E-book path to use for content.

util.url_id(url, file_path)

Get e-book ID for the specified URL.

Parameters

  • url URL
  • file_path Pathname specified in "Remote-*" key.

Returns string E-book ID to use for content.

util.url_packed_path(url)

Get packed e-book path for the specified URL.

Parameters

  • url URL Pathname specified in "Remote-*" key.

Returns string E-book path to use for content.

util.get_mime_for(pathname)

Get MIME-type for the specified MIME type.

Parameters

  • pathname string File to get MIME type for.

Returns string MIME type for that file.

class Configuration(argv[, out])

A unified config.

Constructor: parse commandline arguments.

Parameters

  • argv Array<string> command-line argument array without executable nor script name.
  • out Console (optional, default: global console object)
Configuration.in_file

The descriptor file to read from.

Type: string

Configuration.out_file

The file to which output the resulting ePub.

Type: string

Configuration.rel_root

Relative root for file paths.

Type: string

Configuration.separator

Separator for keys/values.

Default: ":".

Type: string

Configuration.free_date

Whether to try to parse non-RFC3339 date formats.

Default: false.

Type: boolean