A library for parsing EPUB files into JSON, simplifying access to metadata, table of contents, and structural elements. Version 0.2.5 (last updated 2014) is a stable but archaic release with low maintenance. It depends on xml2js, node-zip, and eyes for logging. Unlike modern alternatives (e.g., epub.js), it runs only in Node.js and converts EPUB's internal XML (NCX, OPF) into nested JSON objects, providing both an 'easy' simplified namespace and a 'raw' direct mapping. No longer actively developed; consider for parsing older EPUB2 files, but lacks support for EPUB3, async/await, and streaming.
npm install epub-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of opening an EPUB file and accessing both the simplified 'easy' and detailed 'raw' namespaces from the callback.
Consider migrating to active alternatives like epub.js (browser) or epub2 (Node).
Ensure the argument is a valid file path to an existing .epub file on disk.
Always handle the 'err' parameter in the callback. Use a promise wrapper if needed.
Replace with a modern zip library like adm-zip or yauzl if forking.
Sanitize the HTML output with a library like DOMPurify before rendering.
Run 'npm install node-zip' or add it to your package.json.
Use const epubParser = require('epub-parser') instead of import.Double-check the file path and ensure the file exists.