π epubCreator
CLI tool for compiling a directory into an EPUB ebook
Version: 2.6.1
β¨ Features
π¦ Installation
git clone https://github.com/yourusername/epubcreator.git
cd epubcreator
or download as ZIP
Dependencies
npm install archiver@5.3.0 marked@4.0.0 turndown@7.2.4
For DOCX conversion (optional):
npm install mammoth@1.6.0
π Usage
node epubcreator.js <command> [options]
Available Commands
createconfig
Create config.txt templatecreatechapter
Create a chapter .xhtml template filecreatedir
Create directory structure and template filesconvertch
Convert .md files to .xhtml (valid XHTML output)convertch xhtml2md
Convert .xhtml files to .md (reverse)convertch docx2md
Convert .docx files to .md (split by ## headings)conv ...
Alias for convertchbuild
Build EPUB from current directorylang-id
Switch language to Indonesianlang-en
Switch language to English (US)--version, -v
Show versionhelp, --help
Show help messageπ Directory Structure
./
βββ config.txt β Book metadata (required)
βββ ord.txt β Chapter order list (optional)
βββ Docs/ β Source .docx files (for docx2md)
βββ Markdowns/ β Source .md files (for convertch)
βββ EPUB/
β βββ images/
β β βββ cover.png β REQUIRED
β βββ audiovideo/ β Optional
β βββ bab1.xhtml β Chapters (any name, in EPUB/ root)
β βββ ...
βββ builds/
βββ [folder-name].epub β Build result
π Configuration (config.txt)
# ============================================================
# METADATA BUKU β edit nilai di bawah ini sesuai kebutuhan
# ============================================================
# Judul utama (wajib)
title: Judul Buku
# Subjudul (opsional)
subtitle: Subjudul
# Volume / jilid (opsional)
volume: Vol. 1
# Penulis / creator (wajib)
author: Nama Penulis
# Bahasa (default: en)
language: en
# Identifier unik (URN atau ISBN), kosongkan untuk otomatis
identifier:
# Tanggal terbit (YYYY-MM-DD), kosongkan pakai hari ini
date:
# Penerbit (opsional)
publisher:
# Deskripsi / sinopsis (opsional)
description: Deskripsi singkat buku ini.
# Subjek / kategori, pisahkan dengan koma
subjects: Fiksi, Petualangan
# Nama seri (opsional)
series_name:
# Nomor seri (opsional)
series_number:
# Kontributor tambahan: nama|peran, nama|peran, ...
# Peran: aut (penulis), edt (editor), ill (ilustrator), dll.
contributors:
# Judul tambahan (opsional), pisahkan dengan koma
extra_titles:
# ============================================================
# KONVERSI DOCX β MARKDOWN (opsional)
# ============================================================
# [docx-mapping]
# Jika bagian ini ada, konversi akan menggunakan ukuran font (dalam pt)
# Jika tidak ada, akan menggunakan style Word (Heading 1, Heading 2, dll.)
# heading1 = 24
# heading2 = 18
# heading3 = 14
π Order File (ord.txt)
Optional file to specify chapter order. Each line contains a .xhtml filename:
# Daftar urutan bab (satu baris satu .xhtml)
bab1.xhtml
bab2.xhtml
bab3.xhtml
If ord.txt doesnβt exist, chapters are sorted naturally (numeric-aware).
π Conversion Details
convertch β Markdown β XHTML
## Heading as chapter titleconvertch xhtml2md β XHTML β Markdown
<title> as chapter titleconvertch docx2md β DOCX β Markdown
## headings[docx-mapping] in config.txtποΈ Build Process
The build command:
π Language Support
The tool supports Indonesian (id) and English (en).
π‘ Examples
node epubcreator.js createdir
This creates:
node epubcreator.js createchapter
# Enter filename: bab1.xhtml
# Enter chapter title: Pengantar
node epubcreator.js convertch
node epubcreator.js convertch docx2md
# Or with custom path
node epubcreator.js conv docx2md --output ./MyMarkdowns
node epubcreator.js build
# Output: builds/[folder-name].epub
node epubcreator.js convertch xhtml2md
# Or using the alias
node epubcreator.js conv xhtml2md
π¦ Dependencies
π License
MIT Copyright (C) 2026 YogabyAllwaysever
β Support
If you find this tool useful, please give it a β on GitHub!
Happy EPUB-creating! πβ¨