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

@sunhaixian/md2html

v1.0.0

Published

将 Markdown 文件转换为微信公众号编辑器兼容的 HTML 文件。自动注入内联样式,直接复制到公众号后台即可使用。

Downloads

31

Readme

md2html

将 Markdown 文件转换为微信公众号编辑器兼容的 HTML 文件。

解决什么问题

微信公众号自带的富文本编辑器不支持 Markdown 语法,也不支持 <style> 标签和 CSS class 选择器。直接复制 Markdown 或普通 HTML 过去,样式会全部丢失。

md2html 将 Markdown 解析为 HTML,并自动为每个标签注入内联样式style="..."),打开生成的 HTML 文件,全选复制到公众号后台,样式原样保留。

安装

npm install -g @你的用户名/md2html

用法

md2html 输入文件.md              # 在同目录生成同名 .html
md2html 输入文件.md 输出文件.html # 指定输出路径

示例

# 生成 report.html
md2html report.md

# 指定输出文件
md2html article.md docs/final.html

# 查看帮助
md2html --help

效果预览

| 元素 | 样式 | |------|------| | 标题 H1 | 居中加粗,22px | | 标题 H2 | 左侧蓝色竖线,18px | | 标题 H3 | 加粗 16px | | 正文 | 15px,行高 1.75 | | 引用 | 灰色背景 + 左侧竖线 | | 代码 | 行内代码粉色,代码块灰底圆角 | | 表格 | 带边框,自动适配手机横向滚动 | | 图片 | 居中,自适应宽度 |

工作原理

Markdown (.md)
    │
    ▼
marked 解析为 HTML
    │
    ▼
遍历每个 HTML 标签,注入内联 style 属性
    │
    ▼
包裹完整 HTML 文档
    │
    ▼
输出 .html 文件(可随处复制粘贴)

许可

MIT