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

git-repo-audit

v1.0.0

Published

Codebase audit: churn hotspots, bus factor, bug hotspots, commit trend, firefighting — inspired by piechowski.io

Readme

git-repo-audit

读代码之前先给代码库做个体检 —— 一条命令摸清一个陌生项目的"健康状况"。

基于 The Git Commands I Run Before Reading Any Code 的思路,把作者审计代码库的 5 组诊断命令集成成 6 个零依赖、跨平台的命令行工具。用 Node 实现,不依赖 sort / uniq / head / grep 等 Unix 工具,Windows / macOS / Linux 通用。

安装

# 全局安装,一次装好、到处可用
npm i -g git-repo-audit

本地开发联调:

git clone <repo> && cd git-repo-audit
npm link

使用

在任意 git 仓库中运行:

git-audit                 # 一键体检,输出全部 5 组结果
git-audit src/            # 只统计某个子目录(避免 lockfile 刷榜)
git-audit --since "6 months ago"
git-hotspot               # 改动最频繁的文件
git-bus                   # 贡献者排名(含近 6 个月,识别"巴士因子")
git-bugspots              # bug 高发文件
git-trend                 # 逐月提交趋势
git-fire                  # 回滚/热修复检测

参数

| 参数 | 说明 | 默认值 | | --- | --- | --- | | --path <dir> / 位置参数 | 限定统计目录 | . | | --since <time> | 时间窗口(git 时间表达式) | 1 year ago | | --top <n> | 结果条数 | 20 |

git-hotspot src/ --since "6 months ago" --top 10

各命令说明

| 命令 | 分析内容 | 对应文章 | | --- | --- | --- | | git-audit | 一键体检 + 交叉风险对照 | 全部 | | git-hotspot | 改动最频繁的文件(churn 热点) | 1 | | git-bus | 贡献者排名与"巴士因子"风险 | 2 | | git-bugspots | bug 高发文件(提交信息含 fix/bug/broken) | 3 | | git-trend | 逐月提交趋势,判断项目兴衰 | 4 | | git-fire | revert/hotfix 检测,团队是否在"救火" | 5 |

git-audit 的最后一节是交叉风险对照:同时出现在"改动热点"和"bug 热点"两个列表里的文件 = 最高风险 —— 反复出 bug、反复打补丁,却从未被真正修复。

注意事项

  • 需在 git 仓库内运行;--since 等参数透传给 git log,遵循 git 的时间表达式语法。
  • git-bugspots 依赖规范的提交信息(如约定式提交 fix:);若团队提交信息没有规律,该命令参考价值有限。
  • 中文 / 特殊字符文件名已通过 core.quotepath=false 处理。
  • 在非 git 目录下运行会得到友好的错误提示。

许可

MIT