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

baize-wechat-style

v0.1.0

Published

让 AI Agent 一键将 Markdown 排版为公众号可粘贴的 HTML

Readme

baize-wechat-style

让 AI Agent 一键将 Markdown 排版为公众号可粘贴的 HTML。

npm version License: MIT


为什么做这个工具?

作为一名 AI 资讯博主,我每周要发 3-5 篇文章。每篇写完,排版就要花 30 分钟——选样式、调间距、适配公众号。

baize-wechat-style 是我给自己的工具:

  • AI Agent 写完文章后,直接调用排版函数,一步输出可直接粘贴的 HTML
  • 不用打开浏览器、不用手动选主题、不用来回调样式
  • 零后端依赖,纯 Node.js 库

快速开始

npm install baize-wechat-style

作为 Node.js 库使用(推荐—AI Agent 原生适配)

import { render } from 'baize-wechat-style';

const article = `# 今日 AI 资讯

## Claude 发布新功能

Anthropic 刚刚发布了 Claude 3.5 Sonnet 的更新版本。

\`\`\`python
import anthropic
client = anthropic.Anthropic()
print("Hello AI")
\`\`\`

> 更多内容持续更新中。`;

const result = render(article, { theme: 'ink' });

console.log(result.html);
// → 内联样式的 HTML,直接粘贴到公众号编辑器

作为 CLI 使用

# 输出到控制台
baize-gzh article.md --theme breeze

# 输出到文件
baize-gzh article.md --theme ink -o output.html

# 生成本地预览
baize-gzh preview article.md --theme paper

作为 AI Agent Function Calling 集成

在 OpenAI / Claude / DeepSeek 中注册为 tool:

{
  "function": "render_wechat_article",
  "description": "将 Markdown 排版为公众号可粘贴的 HTML",
  "parameters": {
    "markdown": "string (required): Markdown 格式的文章内容",
    "theme": "string (optional): 主题,可选 ink | paper | breeze"
  }
}

Agent 工作流:写作 → 调用 render → 拿到 HTML → 粘贴到公众号 → 发布。全程 0 手动排版。

可用主题

| 名称 | 展示名 | 风格 | 适合场景 | |------|--------|------|---------| | ink | 墨渊 Ink | 深色科技风,锐利干净 | AI / 技术 / 代码文章 | | paper | 宣纸 Paper | 暖白纸质风,柔和圆角 | 长文 / 深度阅读 | | breeze | 青岚 Breeze | 清新自然风,绿青色 | 生活方式 / 随笔 |

API

render(markdown: string, options?: RenderOptions): RenderResult

RenderOptions

| 参数 | 类型 | 默认值 | 说明 | |------|------|--------|------| | theme | 'ink' \| 'paper' \| 'breeze' | 'ink' | 主题 | | inlineStyle | boolean | true | 是否内联样式 | | wechatSanitize | boolean | true | 是否进行微信兼容过滤 |

RenderResult

| 字段 | 类型 | 说明 | |------|------|------| | html | string | 内联样式后的 HTML | | themeName | string | 主题名称 | | themeDisplayName | string | 主题展示名 |

本地预览

用浏览器打开 preview/index.html,粘贴 Markdown 即可实时预览排版效果。

或者用 CLI:

baize-gzh preview article.md --theme ink
# 生成 article-preview.html,浏览器打开查看

技术栈

| 组件 | 用途 | |------|------| | marked | Markdown → HTML 解析 | | highlight.js | 代码语法高亮 | | juice | CSS 内联化(微信编辑器不识别 <style> 标签) |

开源协议

MIT © 2026 白泽


如果这个工具对你有帮助,欢迎 Star ⭐ 和 PR!

我是白泽,独立 AI 产品开发者,专注于 AI Agent 和 Skill 开发。 关注我,获取更多 AI 开发实战经验。