released 2022-12-03
- Print warnings when given a folder with the
.epub
extension, likeBooks
on macOS exports.
released 2020-05-09
- Throw parser errors more reliably. Skip malformed books when parsing a set, but print a warning message.
released 2020-03-15
- Add
--ignore-drm
flag to the CLI and a matching argument for code equivalents. Prevents false positives on detecting DRM.
released 2019-11-05
- Move
epub
dependency to published version instead of GitHub fork
released 2019-11-03
- Fix broken import in
2.0.0
released 2019-11-03
Basically the entire exposed API was changed with this release. All of the same functionality is still available, but a lot of unnecessary options have been removed. There's a migration guide below.
- ❗ Export structure has changed. Instead of exporting a function, the package exports an object with a few functions
- ❗ The options object has been dropped from the
countWords
js function. All it does count words now, so there's no need to pass configuration - ❗ the
--quiet
CLI flag only works for single files, not directories - ❗ the
--sturdy
CLI flag has been removed. Errors are caught by default and debug info is printing by default. Run withDEBUG=*
to see that output - 🎉 CLI works for multiple files and directories:
word-count book.epub other-book.epub folder-of-books
- 🎉 CLI added the
--text
and--chars
flags for printing the full text of the book and the character count, respectively. Thanks X for the PR! - Better error handling using
debug
. Run the CLI withDEBUG=*
to see debugging output - Use the
parseEpubAtPath
function parse non-standard epubs. You can pass the result to any of the counting functions - Updated the
epub
fork, which should fix some bugs. - Reorganized code and added a lot of tests
This:
// v1.x.x
const wordCount = require('epub-wordcount') // <-- notable change
wordCount('path/to/file', { sturdy: true, print: false }).then((count) =>
console.log('count is', count)
)
becomes:
// v2.x.x
const { countWords } = require('epub-wordcount') // <-- notable change
countWords('path/to/file').then((count) => console.log('count is', count))