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

@ouyangtianfeng/so-git

v1.0.2

Published

一键为项目配置 commitlint + cz-git 的 CLI 工具

Downloads

57

Readme

so-git

一键为项目配置 commitlint + cz-git 的 CLI 工具,自动安装依赖、生成配置文件并注入 package.json 脚本,让你的团队规范 Git 提交流程。

功能

  • 自动检测项目使用的包管理器(pnpm / yarn / npm)
  • 检查并安装缺失的依赖(@commitlint/cli@commitlint/config-conventionalcz-gitczgsimple-git-hooks
  • 在项目根目录生成 commitlint.config.cjs 配置文件(已存在时自动跳过)
  • package.json 注入 scripts 命令和 simple-git-hookscommitizen 配置

安装

# 全局安装
npm install -g so-git

# 或使用 pnpm
pnpm add -g so-git

使用

在项目根目录(需包含 package.json)执行:

so-git init

执行后会自动完成以下操作:

  1. 读取当前项目的 package.json,找出未安装的依赖并批量安装
  2. 在项目根目录生成 commitlint.config.cjs
  3. package.json 写入以下配置:
{
  "scripts": {
    "commit": "czg",
    "prepare": "simple-git-hooks"
  },
  "simple-git-hooks": {
    "commit-msg": "npx commitlint --edit ${1}"
  },
  "commitizen": {
    "path": "node_modules/cz-git"
  }
}
  1. 自动执行 prepare 命令激活 git hooks

生成的 commitlint 配置

生成的 commitlint.config.cjs 支持以下提交类型:

| 类型 | 说明 | |------|------| | feat | 新增功能 | | fix | 修复缺陷 | | docs | 文档变更 | | style | 代码格式 | | refactor | 代码重构 | | perf | 性能优化 | | test | 测试 | | build | 打包构建 | | ci | CI 配置变更 | | revert | 代码回退 | | chore | 构建/工程依赖/工具 | | wip | 正在开发中 | | workflow | 工作流程改进 |

配置了 simple-git-hooks 后,每次执行 git commit 都会自动校验提交信息格式。使用 npm run commit 可以启动交互式提交界面。

开发

# 安装依赖
pnpm install

# 构建
pnpm build

# 全局链接,本地测试
npm link
so-git init

依赖

| 包 | 用途 | |----|------| | @inquirer/prompts | 交互式命令行提示 | | commander | CLI 命令解析 | | execa | 执行子进程命令 | | fs-extra | 文件操作增强 | | ora | 终端加载动画 | | picocolors | 终端彩色输出 |

License

ISC