sandbox-epub
Read an EPUB's metadata, table of contents, and chapters in a Code node or CodeAct action, with epub2 running on the host
- License 许可
- AGPL-3.0
- 最近更新
- 2026-08-18
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- sandbox-epub
- description
- Read an EPUB's metadata, table of contents, and chapters in a Code node or CodeAct action, with epub2 running on the host
02 资源文件 1
- 参考文档package.json837 B
03 SKILL.md 正文
EPUB e-books in the sandbox
Specifier: @nodetool-ai/sandbox-epub. Declare it in the node's packages
property and import it at the top of the body.
epub2 reads from a file path, not a buffer, so this pack is a host module: the host stages your bytes in a temp file for the call and removes it afterward. The import resolves to a generated facade over NodeTool's own implementation.
metadata — title, author, language, and the rest
import { metadata } from "@nodetool-ai/sandbox-epub";
const bytes = await workspace.readBytes("book.epub");
const meta = await metadata(bytes); // { title, creator, language, publisher, ... }
tableOfContents — chapter titles in reading order
import { tableOfContents } from "@nodetool-ai/sandbox-epub";
const toc = await tableOfContents(bytes);
// [{ id, title, href, order }, ...]
extractText — every chapter, concatenated
import { extractText } from "@nodetool-ai/sandbox-epub";
const text = await extractText(bytes);
const withCustomBreaks = await extractText(bytes, { chapterSeparator: "\n\n---\n\n" });
chapterSeparator defaults to "\n\n".
extractChapters — each chapter as its own item
import { extractChapters } from "@nodetool-ai/sandbox-epub";
const chapters = await extractChapters(bytes);
// [{ id, title, href, text }, ...]
Get the bytes from workspace.readBytes, or from a fetched body with
await response.bytes().
Gotchas
- Every export is async.
- 10 MB per book. Larger input is refused by name.
- HTML is stripped, not rendered.
extractText/extractChaptersreturn plain text — no headings, links, or images survive the conversion.
04 同仓库更多 Skills
sandbox-zip
Read and write zip archives in a Code node or CodeAct action, with fflate running on the host under a 50 MB inflation cap
sandbox-yaml
Read and write YAML inside a Code node or CodeAct action, with js-yaml running in the guest
sandbox-xml
Parse XML feeds and sitemaps in a Code node or CodeAct action, with fast-xml-parser running on the host
sandbox-xlsx
Read and write Excel workbooks in a Code node or CodeAct action, with exceljs running on the host
sandbox-twilio
Send SMS and WhatsApp messages and look up numbers from a Code node or CodeAct action, with NodeTool's Twilio request builder running on the host
sandbox-tfjs
Classify and embed images, detect objects, and answer from a passage in a Code node or CodeAct action, with TensorFlow.js running on the host