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

@be-link/be-link-husky

v1.0.6

Published

Modern native Git hooks made easy

Readme

📦 @be-link/be-link-husky

Git hooks 自动化配置工具,统一管理团队开发规范

✨ 特性

  • 🚀 一键配置 - 自动安装 husky、commitlint、lint-staged
  • 🔒 版本锁定 - 根据 Node 版本自动选择兼容的依赖版本
  • 🌲 分支规范 - 强制执行 花名/类型-分支名 命名规范
  • 提交规范 - 基于 conventional commits 校验提交信息
  • 🎨 代码检查 - 提交前自动运行 lint-staged

📦 快速开始

1. 安装

pnpm install @be-link/be-link-husky -D

2. 配置 package.json

{
  "scripts": {
    "prepare": "be-link-husky"
  }
}

支持的参数:

  • -p, --package-manager - 指定包管理器 (默认: pnpm)
  • -r, --registry - 指定 npm registry (默认: https://registry.npmjs.org/)
  • -i, --install - husky 安装目录 (默认: .husky)
  • -s, --skip-install - 跳过依赖安装

示例:

{
  "scripts": {
    "prepare": "be-link-husky -p=npm -r=https://registry.npmjs.org/"
  }
}

3. 首次运行

pnpm install

工具会自动:

  1. ✅ 检测 Node.js 版本
  2. ✅ 安装匹配的依赖
  3. ✅ 配置 git hooks
  4. ✅ 创建 commitlint 配置文件

📝 使用规范

分支命名规范

格式: 花名/类型-分支名

  • 花名:只允许字母(大小写)、下划线、连字符,不允许数字
  • 类型:chore, docs, feat, fix, perf, refactor, revert, style, test, hotfix
  • 分支名:允许字母、数字、下划线、点、连字符

示例

# ✅ 正确
git checkout -b ZhangSan/feat-add-login
git checkout -b LiSi/fix-user-avatar-bug
git checkout -b Wang_Wu/refactor-payment-module

# ❌ 错误
git checkout -b zhang123/feat-add-login    # 花名包含数字
git checkout -b feat/add-login             # 缺少花名
git checkout -b ZhangSan-feat-add-login    # 格式错误

Commit 消息规范

格式: <type>(<scope>): <subject>

支持的类型

| Type | 说明 | 示例 | | ---------- | --------- | -------------------------------- | | feat | 新功能 | feat(user): 添加用户登录功能 | | fix | 修复 Bug | fix(auth): 修复 token 过期问题 | | docs | 文档变更 | docs(readme): 更新安装说明 | | style | 代码格式 | style(app): 统一代码缩进 | | refactor | 重构 | refactor(api): 优化接口结构 | | perf | 性能优化 | perf(list): 优化列表渲染性能 | | test | 测试相关 | test(user): 添加用户模块测试 | | chore | 构建/工具 | chore(deps): 升级依赖版本 |

示例

# ✅ 正确
git commit -m "feat(user): 添加用户登录功能"
git commit -m "fix(cart): 修复购物车计算错误"
git commit -m "docs: 更新 README"

# ❌ 错误
git commit -m "add login"              # 缺少 type
git commit -m "Add: 添加登录功能"       # type 必须小写
git commit -m "feat:添加登录功能"       # 冒号后需要空格

🔧 版本管理策略

设计思想

本工具采用集中式版本管理策略,所有依赖版本由 be-link-husky 统一管理,确保:

  • ✅ 团队成员环境一致
  • ✅ 依赖版本兼容
  • ✅ 规则快速更新

管理的依赖

| 依赖包 | 作用 | Node 16 | Node 18/20 | | --------------------------------- | -------------- | ------- | ----------------- | | husky | Git hooks 管理 | ^8.0.3 | ^8.0.3 / ^9.1.7 | | @commitlint/cli | Commit 校验 | ^17.8.1 | ^20.1.0 | | @commitlint/config-conventional | 标准配置 | ^17.8.1 | ^20.0.0 | | @be-link/commitlint-config | 团队配置 | latest | latest | | lint-staged | 代码检查 | ^13.3.0 | ^15.5.2 / ^16.2.6 |

为什么 @be-link/commitlint-config 使用 latest?
团队内部配置包使用 latest 确保所有项目始终使用最新的规则,保持团队标准统一。

🏗️ 架构设计

用户项目
  ↓ 安装
@be-link/be-link-husky (版本管理器)
  ↓ 自动安装
┌─────────────────────────────────────┐
│ • husky                             │
│ • @commitlint/cli                   │
│ • @commitlint/config-conventional   │
│ • @be-link/commitlint-config        │ ← 纯配置包,只提供规则
│ • lint-staged                       │
└─────────────────────────────────────┘

职责划分:

  • @be-link/be-link-husky:版本管理 + 自动化配置
  • @be-link/commitlint-config:只提供 commit 规则配置

详细设计请查看 架构文档

📚 更多信息

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 License

MIT