husky

typicodeMIT更新放缓

用 npm 脚本轻松配置 Git hooks,在 commit、push 前自动跑 lint、测试等检查,省去手写 shell 脚本的麻烦。

Git hooks made easy 🐶 woof!

v9.1.7发布于 2024-11-18 15:27 UTC35,384star1,102fork同步于 2026-11-10 11:20 UTC

怎么上手

由 README 提炼,执行前请确认
npm install --save-dev husky
硬件要求按 README 说明

README 未说明,纯 Node.js 工具,无 GPU 或显存要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

轻量零依赖的 Git hooks 工具,用 core.hooksPath 让提交前检查自动跑起来

用 npm 脚本轻松配置 Git hooks,在 commit、push 前自动跑 lint、测试等检查,省去手写 shell 脚本的麻烦。

核心能力

  • 用 Git 原生 core.hooksPath 管理钩子
  • gzip 后仅 2 kB 且无任何依赖
  • 运行开销约 1ms,几乎不影响提交
  • 支持全部 13 个客户端 Git 钩子
  • 支持分支级钩子与 POSIX shell 脚本

容易踩的坑

从 v4 升级到 v9 需按文档迁移旧配置;依赖 npm 的 prepare 脚本自动安装钩子,需确保该脚本未被禁用

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v9.1.7
  1. v9.1.7最新正式版2024-11-18 · 2024-11-18 15:27 UTC

    What's Changed

    New Contributors

    Full Changelog: https://github.com/typicode/husky/compare/v9.1.6...v9.1.7

  2. v9.1.62024-09-11 · 2024-09-11 22:14 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/typicode/husky/compare/v9.1.5...v9.1.6

  3. v9.1.52024-08-20 · 2024-08-20 12:37 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/typicode/husky/compare/v9.1.4...v9.1.5

  4. v9.1.42024-07-29 · 2024-07-29 14:55 UTC
    查看更新说明
    • Improve deprecation notice
  5. v9.1.32024-07-26 · 2024-07-26 18:03 UTC
    查看更新说明
    • fix: better handle space in PATH

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    husky

    Node.js CI

    Modern native Git hooks made easy

    Husky improves your commits and more 🐶 woof!

    [!NOTE] Using React? See MistCSS typed CSS components.

    Features

    • Just 2 kB (📦 gzipped) with no dependencies
    • Fastest due to being lightweight (runs in ~1ms)
    • Uses new Git feature (core.hooksPath)
    • Supports:

    And more:

    • Branch-specific hooks
    • Use POSIX shell to script advanced cases
    • Adheres to Git's native hook organization
    • Aligns with npm best practices using prepare script
    • Opt-in/opt-out options
    • User-friendly error messages

    Changelog

    Check out the v9 changelog to discover all the new and improved features!

    Documentation

    https://typicode.github.io/husky

    Important Upgrading from v4 to v9 requires migrating previous config, please see the docs.

    Sponsors

    Support this project by becoming a sponsor here 💖

    GitHub

    Open Collective

    image