npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docsify-to-epub

v1.1.0

Published

将 Docsify 文档站点转换为 EPUB 电子书

Readme

English | 简体中文

docsify-to-epub

docsify-to-epub 是一个将 Docsify 文档站点转换为 EPUB 电子书的 CLI 工具

✨ 特性

  • 📑 智能目录解析:支持解析生成具备层级结构的电子书目录(TOC);在没有侧边栏文件时,也可以自动扫描目录结构。
  • 🔗 标题锚点与内部链接:自动提取 Markdown 的嵌套标题,并支持跨章节的内部链接跳转。
  • 🖼️ 图片资源管理:自动解析和处理所有的本地和远程图片,并打包进 EPUB 中。支持解析引用式图片链接。
  • 🎨 样式与主题支持:支持注入自定义 CSS 文件,并且可以通过 --theme 参数自动抓取远程 Docsify 主题样式。
  • 💻 代码高亮:内置代码语法高亮支持,代码片段在电子书阅读器中也能清晰展示。
  • 📚 元数据与封面:支持设置书籍标题、作者以及自定义封面图片。

📦 安装

您可以将其安装为本地或全局依赖:

npm install -g docsify-to-epub

或者直接使用 npx 运行:

npx docsify-to-epub <dir>

🚀 使用方法

基本的转换命令(假设您的文档存放在 docs 目录):

dtoe docs/
dtoe docs/ -t "书籍标题" -a "作者" -c cover.jpg  --theme -v

这会在当前目录下生成一个与文档系统同名的 .epub 文件。

命令行选项

dtoe <dir> [options]

参数:
  <dir>                      Docsify 文档目录路径

选项:
  -o, --output <file>        输出文件路径 (默认: <书名>.epub)
  -t, --title <title>        书籍标题
  -a, --author <author>      作者名称 (默认: "Unknown")
  -c, --cover <image>        封面图片路径
  --css <file>               自定义 CSS 文件路径
  --theme                    下载远程 Docsify 主题样式
  -v, --verbose              显示详细日志
  -h, --help                 显示帮助信息

示例

1. 指定输出文件、作者和书籍标题

dtoe docs/ -o output/my-book.epub -t "我的技术文档" -a "John Doe"

2. 添加封面图并使用远程主题样式

dtoe docs/ -c cover.jpg --theme

3. 显示详细构建日志

dtoe docs/ -v

📄 许可证

MIT