pubsie

1.1.5 • Public • Published

Pubsie

A JavaScript package for parsing EPUB files and extracting their contents. This package provides a convenient way to extract metadata, chapters, and other resources from EPUB files in your JavaScript applications.

Usage/Examples

const pubsie = require("pubsie");

let pub = new pubsie('path/to/epub');

pub.on("error", (err) => {
  console.log(err.message);

  if (err.data.name == "NoNcxError") {
    // ... process error
  };
});

pub.parse(); // always call after event listener

pub.buildCache('path/to/write/location') // build a cache of parsed data

console.log(pub.epub) // .epub property stores parsed data

Installation

Install pubsie with npm

  npm i pubsie

Running Tests

To run tests, run the following command

in tests directory, create a data directory and place epub files inside

tests
├───data
│   ├───moby-dick.epub
│   └───dracula.epub
└───global
  npm run test

Important

all epubs for testing are derived from Project Gutenberg

License

Pubsie is provided under the MIT license

Author

Dependencies (2)

Dev Dependencies (2)

Package Sidebar

Install

npm i pubsie

Weekly Downloads

4

Version

1.1.5

License

MIT

Unpacked Size

28.2 kB

Total Files

24

Last publish

Collaborators

  • downmoto