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

testgen-cn

v1.0.0

Published

AI-powered test case generator with Chinese annotations — 自动生成测试用例

Readme

🧪 TestGen CN

AI 自动生成测试用例 — 一行命令给你的代码写测试

npm version license

你写代码,它写测试。 自动检测函数→分析参数→生成 Jest/pytest 测试用例——包括正常调用、空值边界、异常处理、异步操作。

✨ 为什么用 TestGen CN?

| | 手写测试 | TestGen CN | |---|---|---| | 写测试时间 | 😰 每个函数 5-30 分钟 | 🚀 所有函数几秒钟 | | 覆盖率 | 😅 往往不够 | 🎯 自动覆盖边界+异常 | | 测试质量 | 😞 参差不齐 | ✅ 标准化模板 | | 中文注释 | ❌ | ✅ 中文描述 |

🚀 快速开始

npm install -g testgen-cn
testgen

📦 高级用法

# 指定测试框架
testgen -f pytest
testgen -f jest

# 指定路径
testgen -i ./src -o ./test

# 排除目录
testgen -e fixtures,mocks

🧪 自动生成的测试类型

  • ✅ 正常调用 — 验证预期输入返回正确结果
  • 🔲 边界值 — 空值、零值、极限值
  • ⚠️ 异常处理 — 错误输入抛出预期异常
  • ⏳ 异步操作 — async/await 正确完成

🛠️ 三件套齐备

npm install -g autodoc-cn code2flow-cn testgen-cn

autodoc     # 📝 生成文档
code2flow   # 📊 生成图表
testgen     # 🧪 生成测试

🤝 赞助

完全开源 MIT。有用就 Star ⭐