1.1.5 • Published 10 months ago

pubsie v1.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

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

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago