Navigate:
~$HUSKY0.1%

husky: Git hooks made easy

Manage Git hooks via Node.js package.

LIVE RANKINGS • 06:52 AM • STEADY
OVERALL
#172
30
DEVELOPER TOOLS
#34
6
30 DAY RANKING TREND
ovr#172
·Devel#34
STARS
34.6K
FORKS
1.1K
DOWNLOADS
15.6M
7D STARS
+17
7D FORKS
-1
See Repo:
Share:

Learn more about husky

Husky is a Node.js package that facilitates the installation and management of Git hooks. It leverages Git's core.hooksPath configuration to store hooks in a project directory rather than the standard .git/hooks location. The tool supports all 13 client-side Git hooks and runs with minimal overhead, approximately 1ms per execution. Common use cases include running linters, tests, and commit message validation before commits are made or branches are pushed.

husky

1

Native Git hooks approach

Uses Git's core.hooksPath feature to store hooks within the project repository, allowing hooks to be version-controlled and shared across team members without requiring custom installation scripts.

2

Zero external dependencies

The package is 2 kB gzipped and contains no external dependencies, reducing installation overhead and potential compatibility issues in project environments.

3

Broad platform and tool support

Functions across macOS, Linux, and Windows, and integrates with Git GUIs, Node version managers, monorepos, and nested project structures without requiring special configuration.


// .husky/pre-commit
import { execSync } from 'child_process';

try {
  execSync('npm run lint', { stdio: 'inherit' });
  execSync('npm test', { stdio: 'inherit' });
} catch (error) {
  console.error('Pre-commit checks failed');
  process.exit(1);
}

vv9.1.7

Patch release that improves the deprecation warning label; no breaking changes or new requirements.

  • Deprecation warnings now include a 'husky' label for easier identification in logs.
  • No action required; upgrade is safe for all v9.x users with no behavior changes.
vv9.1.6

Patch release fixing incorrect generation of the example pre-commit hook file.

  • Update to correct malformed pre-commit template that may have broken hook execution in fresh installs.
  • No breaking changes or new requirements; safe drop-in upgrade for existing Husky v9.1.x users.
vv9.1.5

Adds support for the pre-merge-commit Git hook, fixing issue #1494.

  • Use pre-merge-commit hook to run checks during git merge --squash workflows.
  • No breaking changes or migration steps required for this patch release.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers