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-list-repos

v1.0.0

Published

A high-performance Node.js tool to recursively scan, monitor, and sync multiple Git repositories in your workspace.

Readme

Git 仓库批量扫描与管理工具 (git-list-repos)

这是一个基于 Node.js 开发的高效 Git 仓库管理工具。它能帮助开发者在复杂的工作空间中快速洞察所有项目的 Git 状态,并自动化处理常见的同步任务。

🚀 使用方法

1. 直接运行 (npx)

无需安装,直接在你的工作空间根目录下运行:

npx git-list-repos

注:如果尚未发布到 npm,可以使用 npx github:<your-username>/git-list-repos 进行测试。

2. 本地开发与调试

如果你想在本地进行调试或贡献代码:

# 克隆仓库
git clone https://github.com/<your-username>/git-list-repos.git
cd git-list-repos

# 方式 A:通过 npm link 注册全局命令 (推荐)
npm link
git-list-repos

# 方式 B:直接通过 node 运行
node list-repos.js

# 方式 C:使用 npx 指向本地目录
npx .

核心功能

  1. 高效扫描
    • 默认支持 4层 递归扫描。
    • 深度搜索:即使目录本身不是 Git 仓库,也会继续向下探测隐藏的 Git 项目。
    • 智能过滤:自动忽略 node_modules 和隐藏目录,扫描速度极快。
  2. 状态监控
    • 实时分析分支名称、未提交变更 (M)。
    • 计算与远程仓库的同步差异(Ahead/Behind)。
  3. 自动化同步
    • 自动 Pull:对 100% 无冲突的仓库自动执行更新。
    • 空仓库初始化:检测到远程为空时,自动推送本地分支并建立关联。
  4. 远程修复
    • 通过 remote-fix.json 批量更换失效的远程仓库地址。

配置项

在本地运行或通过 npm 安装后,可以修改脚本顶部的配置:

| 配置项 | 默认值 | 说明 | | :--- | :--- | :--- | | MAX_DEPTH | 4 | 目录递归扫描的最大深度 | | SHOW_NON_GIT | false | 是否显示不含 Git 仓库的文件夹 | | AUTO_PULL | true | 是否自动拉取无冲突的代码 |

远程地址批量修复流程

  1. 运行 npx git-list-repos
  2. 如果有无法连接的地址,脚本会生成 remote-fix.json
  3. 在文件中填入新的 newUrl
  4. 再次运行命令,脚本将自动完成地址更换、可用性检测及代码同步。

统计信息

扫描结束后,脚本会输出详细的统计数据,包括扫描文件夹总数、Git 仓库总数等。


License: MIT