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

draftpage

v0.2.0

Published

Compile Markdown drafts and diagram DSL into self-contained HTML pages.

Readme

Draftpage

Draftpage 将 Markdown 草稿与图表 DSL 编译为自包含 HTML 页面。兼具纯计算编译器库与开箱即用的命令行工具。

draftpage/
├── core/             # 纯计算型单文件 ESM 编译器(零运行时依赖、纯内存转译)
├── host/             # 薄宿主层(拥有文件 I/O、原子写入、时间戳注入与 CLI 参数解析)
├── bin/              # CLI 入口(draftpage 命令)
└── skills/draftpage/ # Agent 调用技能(基于 bunx draftpage)

架构与物理边界

  • core/:内部保持绝对纯洁。零外部运行时依赖,兼容浏览器、Node.js 与 Bun。严禁引入文件 I/O、系统时间或环境发现。由 test/boundary.test.js 和 esbuild browser 编译目标自动化守卫。
  • host/:薄宿主适配层。负责文件读写、时间戳注入、原子替换 HTML 与终端格式化。
  • 单包统一发布:对外统一为 npm 包 draftpage。既可 import { compile } from 'draftpage' 作为纯函数库引用,也可直接执行 draftpage 命令行。

快速上手

1. 使用 Bunx(发布后免安装)

无需全局安装任何 CLI,直接运行:

bunx draftpage guide
bunx draftpage info flow
bunx draftpage build page.md -o page.html --json

2. 本地开发

在仓库根目录下运行:

bun install
bun run build
bun ./bin/draftpage.js guide
bun ./bin/draftpage.js info flow
bun ./bin/draftpage.js build core/examples/tcp.md -o /tmp/tcp.html --json
bun run check  # 校验全量构建、类型检查、738 项测试及边界哨兵

Agent Skill 接入

Agent Skill 位于 skills/draftpage/SKILL.md。

若使用支持 ~/.agent/skills/ 的 Agent,直接软链接:

mkdir -p ~/.agent/skills
ln -s "$PWD/skills/draftpage" ~/.agent/skills/draftpage

AI 通过 bunx draftpage ... 渐进式获取输入规则与组件语法,并使用 --json 获取紧凑诊断闭环修复源稿。

编译与发布

bun run release:prepare  # 构建、测试、打包校验并输出至 output/release/
bun publish ./output/release/draftpage-0.2.0.tgz --access public  # 手动发布

详细发布说明见 PUBLISH.md。