lesjoursfr / html-to-epub

Generate EPUB books from HTML with simple API in Node.js.
MIT License
39 stars 16 forks source link

npm version QC Checks

@lesjoursfr/html-to-epub

Generate EPUB books from HTML with simple API in Node.js. Inspired by cyrilis/epub-gen

What is this library?

This epub library will generate temp html and download images in your DOMs, then generate the epub book you want.

Usage

Install the lib and add it as a dependency :

    npm install @lesjoursfr/html-to-epub

Then put this in your code:

const { EPub } = require("@lesjoursfr/html-to-epub");

const epub = new EPub(option, output);
epub.render()
    .then(() => {
        console.log("Ebook Generated Successfully!");
    })
    .catch((err) => {
        console.error("Failed to generate Ebook because of ", err);
    });

Options

Output

If you don't want pass the output pass the output path as the second argument, you should specify output path as option.output.