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