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

md-unbase

v0.1.0

Published

将 Markdown 文件中嵌入的 base64 图片提取为独立文件的命令行工具。

Readme

md-unbase

将 Markdown 文件中嵌入的 base64 图片提取为独立文件的命令行工具。

功能特性

  • 支持 PNG、JPEG、GIF 格式的 base64 图片
  • 使用图片内容 hash 命名,自动去重
  • 图片保存在 Markdown 文件同目录下
  • 支持预览模式(dry-run)

使用

无需安装,直接运行:

npx md-unbase <file.md>

或使用其他包管理器:

bunx md-unbase <file.md>
pnpm dlx md-unbase <file.md>

全局安装

npm install -g md-unbase
# 或
pnpm add -g md-unbase

安装后可直接使用:

md-unbase <file.md>

命令选项

| 选项 | 说明 | | --------------- | ------------------------ | | -h, --help | 显示帮助信息 | | -v, --version | 显示版本号 | | --dry-run | 预览模式,不实际修改文件 |

示例

提取图片:

md-unbase document.md

输出:

✓ Extracted 3 image(s)
  - a1b2c3d4.png (125.00 KB)
  - e5f6g7h8.jpg (89.50 KB)
  - i9j0k1l2.gif (45.25 KB)
✓ File updated: document.md

预览模式:

md-unbase document.md --dry-run

输出:

Would extract 3 image(s):
  - a1b2c3d4.png (125.00 KB)
  - e5f6g7h8.jpg (89.50 KB)
  - i9j0k1l2.gif (45.25 KB)

工作原理

  1. 读取 Markdown 文件
  2. 匹配 ![alt](data:image/xxx;base64,...) 格式的图片
  3. 解码 base64 数据,计算 MD5 hash(前 8 位)作为文件名
  4. 将图片保存到 Markdown 文件同目录
  5. 更新 Markdown 中的图片引用

License

MIT