# e-writer

> Create EPUB from JSON

Latest version **0.2.0** (published 2023-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install e-writer
pnpm add e-writer
yarn add e-writer
bun add e-writer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-11-22 |
| First published | 2022-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 174.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Adam Quinton |
| Maintainers | zvakanaka |
| Keywords | epub, ebook, json, converter, epub3 |

## Links

- npm: https://www.npmjs.com/package/e-writer
- Repository: https://github.com/zvakanaka/e-writer
- Homepage: https://github.com/zvakanaka/e-writer#readme
- Issues: https://github.com/zvakanaka/e-writer/issues
- npm.io page: https://npm.io/package/e-writer

## Dependencies (1)

- [zx](https://npm.io/package/zx.md) ^6.1.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.0 (latest) — 2023-11-22
- 0.1.2 — 2023-11-22
- 0.1.1 — 2022-05-25
- 0.1.0 — 2022-05-25

## README

[![npm](https://img.shields.io/npm/v/e-writer/latest)](https://www.npmjs.com/package/e-writer)  

Creates an EPUB file from a JSON object.

```js
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 
- [x] Images
  - [x] Custom cover image
- [x] Sections (sub-chapters)
- [ ] Custom CSS/fonts
- [ ] Output file as stream/buffer

## Thank You
[Matt Garrish's EPUB3 Samples](https://github.com/IDPF/epub3-samples/tree/main/30/accessible_epub_3)

---
_Source: https://npm.io/package/e-writer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
