talira

simple-git-hooks

A zero-dependency tool to manage git hooks from package.json

open sourceMITfree

simple-git-hooks manages git hooks for JavaScript projects with zero dependencies and a small configuration: one object in package.json maps hooks such as pre-commit or pre-push to commands, and running the tool installs them. It's lightweight compared with alternatives such as Husky, lefthook and pre-commit, and projects such as PostCSS, Nano ID and VitePress use it.

Problems it solves

  • run linting before every git commit in a Node project
  • set up git hooks without Husky
  • share git hooks with a team through package.json

Features

  • zero dependencies
  • git hooks configured in package.json
  • small install size

Alternatives

The same job

These do what simple-git-hooks does.

  1. Husky Native Git hooks for npm projects, in 2 kB with no dependencies
  2. pre-commit A framework for managing and maintaining multi-language pre-commit hooks.
  3. pre-commit (npm) Installs a git pre-commit hook that runs your npm scripts before each commit
  4. commitlint Lint commit messages against your team's commit convention
  5. lint-staged Run tasks like formatters and linters against files staged in Git
  6. Lefthook Fast and powerful Git hooks manager for any type of projects.

Compare simple-git-hooks with the top 3