Simple Node.js wrapper of KindleUnpack to unpack Amazon / Kindlegen generated ebooks.
npm install kindleunpack*.mobi)
*.prc)
*.azw)
*.azw3)
*.azw4)
bash
npm install kindleunpack
`
Usage
`javascript
const { unpack } = require("kindleunpack");
unpack("test.mobi", "output/ebook1");
unpack("test.azw3", "output/ebook2", {
use_hd: false,
split_combos: false,
apnx_file: "",
epub_version: "2",
write_raw: false,
dump: false,
});
`
$3
- ebookFile string - path to the desired Kindle/MobiPocket ebook
- outputDir string (optional) - output directory (default: ".")
- options object (optional)
- use_hd boolean (optional) - use HDImages to overwrite lower resolution versions, if present
- split_combos boolean (optional) - split combination mobis into older mobi and mobi KF8 ebooks
- apnx_file string (optional) - path to a .apnx file that contains real page numbers associated with an azw3 ebook
- epub_version 2|3|A|F (optional) - pecify EPUB version to unpack to: 2, 3 or A (for automatic) or F for Force to EPUB2, default is 2
- write_raw boolean (optional) - write raw data to the output folder
- dump boolean (optional) - dump headers and other debug info to output and extra files
Returns Promise<{ stdout: string; stderr: string }>
CLI
`bash
kindleunpack [-r -s -d -h -i] [-p APNX_FILE] ebookFile outputDir
`
$3
- ebookFile - path to the desired Kindle/MobiPocket ebook
- outputDir - output directory
$3
- -i - use HDImages to overwrite lower resolution versions, if present
- -s - split combination mobis into older mobi and mobi KF8 ebooks
- -r - write raw data to the output folder
- -d - dump headers and other debug info to output and extra files
- --epub_version= - specify EPUB version to unpack to: 2, 3 or A (for automatic) or F for Force to EPUB2, default is 2
- -p APNX_FILE - path to a .apnx file that contains real page numbers associated with an azw3 ebook (optional). Note: many apnx files have arbitrarily assigned page offsets that will confuse KindleUnpack if used
Development
$3
`bash
pip3 install -i https://mirrors.aliyun.com/pypi/simple/ pyinstaller
pyinstaller -F "kindleunpack.py"
``