0.2.0 • Published 6 months ago

e-writer v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

npm

Creates an EPUB file from a JSON object.

import writeEpub from 'e-writer';

await writeEpub({
  title: 'My Book',
  isbn: '1234567890123',
  outFileName: 'my-book.epub',
  coverImage: 'cover.jpg', // optional - if not supplied then `title` is used as cover 
  images: ['sunset.jpg'], // optional
  creator: 'John Doe',
  authorFirstname: 'John',
  authorSurname: 'Doe',
  chapters: [
    {
      title: 'Chapter 1',
      content: `Content of chapter 1.
<img id="sunset" src="images/sunset.jpg" alt="A great sunset" />`,
    },
    {
      title: 'Chapter 2',
      content: 'Content of chapter 2.',
    },
  ],
})

Roadmap

  • Images
    • Custom cover image
  • Sections (sub-chapters)
  • Custom CSS/fonts
  • Output file as stream/buffer

Thank You

Matt Garrish's EPUB3 Samples

0.1.2

6 months ago

0.2.0

6 months ago

0.1.1

2 years ago

0.1.0

2 years ago