Gathering detailed insights and metrics for lefthook
Gathering detailed insights and metrics for lefthook
Gathering detailed insights and metrics for lefthook
Gathering detailed insights and metrics for lefthook
lefthook-linux-x64
The Linux 64-bit binary for lefthook, git hooks manager.
lefthook-windows-x64
The Windows 64-bit binary for lefthook, git hooks manager.
lefthook-darwin-arm64
The macOS ARM 64-bit binary for lefthook, git hooks manager.
@evilmartians/lefthook
Simple git hooks manager
Fast and powerful Git hooks manager for any type of projects.
npm install lefthook
Typescript
Module System
Node Version
NPM Version
90.4
Supply Chain
100
Quality
91.2
Maintenance
100
Vulnerability
100
License
Go (90.84%)
Ruby (4.18%)
JavaScript (1.89%)
Shell (1.85%)
Python (0.73%)
Makefile (0.52%)
Total Downloads
17,151,927
Last Day
32,749
Last Week
416,091
Last Month
1,733,842
Last Year
13,008,183
MIT License
6,115 Stars
989 Commits
234 Forks
28 Watchers
5 Branches
152 Contributors
Updated on Jun 30, 2025
Minified
Minified + Gzipped
Latest Version
1.11.14
Package Id
lefthook@1.11.14
Unpacked Size
23.24 kB
Size
5.46 kB
File Count
6
NPM Version
10.8.2
Node Version
20.19.2
Published on
Jun 16, 2025
Cumulative downloads
Total Downloads
Last Day
20.2%
32,749
Compared to previous day
Last Week
-3.7%
416,091
Compared to previous week
Last Month
4.5%
1,733,842
Compared to previous month
Last Year
284.6%
13,008,183
Compared to previous year
A Git hooks manager for Node.js, Ruby, Python and many other types of projects.
With Go (>= 1.24):
1go install github.com/evilmartians/lefthook@latest
1go get -tool github.com/evilmartians/lefthook
With NPM:
1npm install lefthook --save-dev
For Ruby:
1gem install lefthook
For Python:
1pip install lefthook
Installation guide with more ways to install lefthook: apt, brew, winget, and others.
Configure your hooks, install them once and forget about it: rely on the magic underneath.
1# Configure your hooks 2vim lefthook.yml 3 4# Install them to the git project 5lefthook install 6 7# Enjoy your work with git 8git add -A && git commit -m '...'
lefthook.yml
config options.Gives you more speed. docs
1pre-push: 2 parallel: true
If you want your own list. Custom and prebuilt examples.
1pre-commit: 2 jobs: 3 - name: lint frontend 4 run: yarn eslint {staged_files} 5 6 - name: lint backend 7 run: bundle exec rubocop --force-exclusion {all_files} 8 9 - name: stylelint frontend 10 files: git diff --name-only HEAD @{push} 11 run: yarn stylelint {files}
If you want to filter list of files. You could find more glob pattern examples here.
1pre-commit: 2 jobs: 3 - name: lint backend 4 glob: "*.rb" # glob filter 5 exclude: '(^|/)(application|routes)\.rb$' # regexp filter 6 run: bundle exec rubocop --force-exclusion {all_files}
If you want to execute the commands in a relative path
1pre-commit: 2 jobs: 3 - name: lint backend 4 root: "api/" # Careful to have only trailing slash 5 glob: "*.rb" # glob filter 6 run: bundle exec rubocop {all_files}
If oneline commands are not enough, you can execute files. docs
1commit-msg: 2 jobs: 3 - script: "template_checker" 4 runner: bash
If you want to control a group of commands. docs
1pre-push: 2 jobs: 3 - name: audit packages 4 tags: 5 - frontend 6 - linters 7 run: yarn lint 8 9 - name: audit gems 10 tags: 11 - backend 12 - security 13 run: bundle audit
If you are in the Docker environment. docs
1pre-commit: 2 jobs: 3 - script: "good_job.js" 4 runner: docker run -it --rm <container_id_or_name> {cmd}
If you are a frontend/backend developer and want to skip unnecessary commands or override something in Docker. docs
1# lefthook-local.yml 2pre-push: 3 exclude_tags: 4 - frontend 5 jobs: 6 - name: audit packages 7 skip: true
If you want to run hooks group directly.
1$ lefthook run pre-commit
If you want to run specific group of commands directly.
1fixer: 2 jobs: 3 - run: bundle exec rubocop --force-exclusion --safe-auto-correct {staged_files} 4 - run: yarn eslint --fix {staged_files}
1$ lefthook run fixer
You can control what lefthook prints with output option.
1output: 2 - execution 3 - failure
Check examples
No vulnerabilities found.
Reason
30 commit(s) and 16 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
packaging workflow detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 10/29 approved changesets -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
Project has not signed or included provenance with any releases.
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More