# @epubook/core

Latest version **0.0.12-beta.4** (published 2026-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @epubook/core
pnpm add @epubook/core
yarn add @epubook/core
bun add @epubook/core
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.12-beta.4 |
| Published | 2026-09-05 |
| First published | 2023-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=v20.10.0 |
| Dependencies | 5 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 11 |
| Author | XLor |
| Maintainers | yjl9903 |
| Keywords | ebook, epub, epub-generator, epubook |

## Links

- npm: https://www.npmjs.com/package/@epubook/core
- Repository: https://github.com/yjl9903/epubook
- Homepage: https://github.com/yjl9903/epubook#readme
- Issues: https://github.com/yjl9903/epubook/issues
- npm.io page: https://npm.io/package/@epubook/core

## Dependencies (5)

- [defu](https://npm.io/package/defu.md) ^6.1.7
- [pathe](https://npm.io/package/pathe.md) ^2.0.3
- [fflate](https://npm.io/package/fflate.md) ^0.8.3
- [@epubook/xml](https://npm.io/package/@epubook/xml.md) 0.0.12-beta.4
- [fast-xml-parser](https://npm.io/package/fast-xml-parser.md) ^5.7.2

## Recent versions

- 0.0.12-beta.4 (latest) — 2026-09-05
- 0.0.12-beta.2 — 2026-05-04
- 0.0.12-beta.1 — 2026-05-04
- 0.0.11 — 2023-08-23
- 0.0.10 — 2023-04-10
- 0.0.9 — 2023-03-09
- 0.0.8 — 2023-03-09
- 0.0.7 — 2023-03-09
- 0.0.6 — 2023-03-09
- 0.0.5 — 2023-03-05
- 0.0.4 — 2023-03-04
- 0.0.3 — 2023-03-03
- 0.0.2 — 2023-02-28

## README

# @epubook/core

[![version](https://img.shields.io/npm/v/@epubook/core?color=rgb%2850%2C203%2C86%29&label=@epubook/core)](https://www.npmjs.com/package/@epubook/core) [![CI](https://github.com/yjl9903/epubook/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/epubook/actions/workflows/ci.yml)

The fundamental module of [epubook](https://github.com/yjl9903/epubook). It provides low-level API for generating EPUB books.

## Installation

```bash
npm i @epubook/core
```

## Usage

```ts
import { Epub, HTML } from '@epubook/core'

const book = new Epub({
  title: 'Test Book',
  date: new Date('2023-02-01T11:00:00.000Z'),
  lastModified: new Date('2023-02-26T11:00:00.000Z'),
  creator: 'XLor',
  description: 'for test usage',
  source: 'imagine'
})

const page = new HTML('start.xhtml', '...')

book.item(page).spine(page).toc([{ title: 'Start', page }])

await book.writeFile('./test.epub')
```

### JSX

You can use jsx to create XHTML node.

```tsx
/** @jsxImportSource @epubook/xml */

import { XHTMLBuilder } from '@epubook/core'

const builder = new XHTMLBuilder()

const xhtml = builder
  .appendBody(<h1>Title</h1>)
  .appendBody(<p>This is a paragraph</p>)
  .build()
```

You can see [@epubook/theme](https://github.com/yjl9903/epubook/tree/main/packages/theme) for more details.

## License

MIT License © 2023 [XLor](https://github.com/yjl9903)

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