husky
Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)
Last updated 7 years ago by typicode .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install husky 
SYNC missed versions from official npm registry.

husky Mac/Linux Build Status Windows Build status

Git hooks made easy

Husky can prevent bad git commit, git push and more :dog: woof!

You're viewing the documentation for the next version of husky, click here if you prefer to use the stable release

Install

npm install husky@next --save-dev
// package.json
{
  "husky": {
    "hooks": {
      "pre-commit": "npm test",
      "pre-push": "npm test",
      "...": "..."
    }
  }
}
git commit -m 'Keep calm and commit'

By default, husky expects your project's package.json and your .git directory to be at the same level. It can be configured to support monorepos or sub-directories.

Check documentation for more.

Uninstall

npm uninstall husky

Upgrading from 0.14

If you're upgrading from 0.14, simply move your hooks to husky.hooks:

{
  "scripts": {
-   "precommit": "npm test"
  },
+ "husky": {
+   "hooks": {
+     "pre-commit": "npm test"
+   }
+ }
}

Or run the following command which will do the same automatically for you ;)

./node_modules/.bin/husky-upgrade

Alternatively, you can also use any of the files/formats that are supported by cosmiconfig. This means that you can place your husky hooks config in a .huskyrc file or export them from a husky.config.js file as well. Cosmiconfig supports js, json, and yaml file formats.

Features

  • Keeps existing user hooks
  • Supports GUI Git clients
  • Supports all Git hooks (pre-commit, pre-push, ...)
  • Auto-migrates Git hooks installed by ghooks

Used by

See also

  • pkg-ok - Prevents publishing a module with bad paths or incorrect line endings
  • please-upgrade-node - Show a message to upgrade Node instead of a stacktrace in your CLIs
  • react-fake-props - Fake props for your React tests

License

MIT - Typicode :cactus: - Patreon

Current Tags

  • 9.1.6                                ...           latest (2 months ago)

214 Versions

  • 9.1.6                                ...           2 months ago
  • 9.1.5                                ...           3 months ago
  • 9.1.4                                ...           4 months ago
  • 9.1.3                                ...           4 months ago
  • 9.1.2                                ...           4 months ago
  • 9.1.1                                ...           4 months ago
  • 9.1.0                                ...           4 months ago
  • 9.0.11                                ...           9 months ago
  • 9.0.10                                ...           9 months ago
  • 9.0.9                                ...           9 months ago
  • 9.0.8                                ...           9 months ago
  • 9.0.7                                ...           10 months ago
  • 9.0.6                                ...           10 months ago
  • 9.0.5                                ...           10 months ago
  • 9.0.4                                ...           10 months ago
  • 9.0.3                                ...           10 months ago
  • 9.0.2                                ...           10 months ago
  • 9.0.1                                ...           10 months ago
  • 8.0.3                                ...           2 years ago
  • 8.0.2                                ...           2 years ago
  • 8.0.1                                ...           3 years ago
  • 8.0.0                                ...           3 years ago
  • 7.0.4                                ...           3 years ago
  • 7.0.3                                ...           3 years ago
  • 7.0.2                                ...           3 years ago
  • 7.0.1                                ...           3 years ago
  • 7.0.0                                ...           3 years ago
  • 6.0.0                                ...           4 years ago
  • 5.2.0                                ...           4 years ago
  • 5.1.3                                ...           4 years ago
  • 5.1.2                                ...           4 years ago
  • 5.1.1                                ...           4 years ago
  • 5.1.0                                ...           4 years ago
  • 5.0.9                                ...           4 years ago
  • 5.0.8                                ...           4 years ago
  • 5.0.7                                ...           4 years ago
  • 4.3.8                                ...           4 years ago
  • 4.3.7                                ...           4 years ago
  • 4.3.6                                ...           4 years ago
  • 5.0.6                                ...           4 years ago
  • 5.0.5                                ...           4 years ago
  • 4.3.5                                ...           4 years ago
  • 4.3.4                                ...           4 years ago
  • 4.3.3                                ...           4 years ago
  • 4.3.2                                ...           4 years ago
  • 4.3.1                                ...           4 years ago
  • 5.0.4                                ...           4 years ago
  • 5.0.3                                ...           4 years ago
  • 5.0.2                                ...           4 years ago
  • 5.0.1                                ...           4 years ago
  • 5.0.0                                ...           4 years ago
  • 5.0.0-beta.0                                ...           4 years ago
  • 5.0.0-alpha.6                                ...           4 years ago
  • 5.0.0-alpha.5                                ...           4 years ago
  • 5.0.0-alpha.4                                ...           4 years ago
  • 5.0.0-alpha.3                                ...           4 years ago
  • 5.0.0-alpha.2                                ...           4 years ago
  • 5.0.0-alpha.1                                ...           4 years ago
  • 5.0.0-alpha.0                                ...           4 years ago
  • 4.3.0                                ...           4 years ago
  • 4.2.5                                ...           5 years ago
  • 4.2.4                                ...           5 years ago
  • 4.2.3                                ...           5 years ago
  • 4.2.2                                ...           5 years ago
  • 4.2.1                                ...           5 years ago
  • 4.2.0                                ...           5 years ago
  • 4.1.0                                ...           5 years ago
  • 4.0.10                                ...           5 years ago
  • 4.0.9                                ...           5 years ago
  • 4.0.8                                ...           5 years ago
  • 4.0.7                                ...           5 years ago
  • 4.0.6                                ...           5 years ago
  • 4.0.5                                ...           5 years ago
  • 4.0.4                                ...           5 years ago
  • 4.0.3                                ...           5 years ago
  • 4.0.2                                ...           5 years ago
  • 4.0.1                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 4.0.0-beta.5                                ...           5 years ago
  • 4.0.0-beta.4                                ...           5 years ago
  • 3.0.9                                ...           5 years ago
  • 4.0.0-beta.3                                ...           5 years ago
  • 3.0.8                                ...           5 years ago
  • 3.0.7                                ...           5 years ago
  • 4.0.0-beta.2                                ...           5 years ago
  • 3.0.6                                ...           5 years ago
  • 3.0.5                                ...           5 years ago
  • 3.0.4                                ...           5 years ago
  • 4.0.0-beta.1                                ...           5 years ago
  • 4.0.0-beta.0                                ...           5 years ago
  • 3.0.3                                ...           5 years ago
  • 3.0.2                                ...           5 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 3.0.0-0                                ...           5 years ago
  • 2.7.0                                ...           5 years ago
  • 2.6.0                                ...           5 years ago
  • 2.5.0                                ...           5 years ago
  • 2.4.1                                ...           5 years ago
  • 2.4.0                                ...           5 years ago
  • 2.3.0                                ...           6 years ago
  • 2.2.0                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.3.1                                ...           6 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.1                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.4                                ...           6 years ago
  • 1.1.3                                ...           6 years ago
  • 1.1.2                                ...           6 years ago
  • 1.1.1                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 1.0.0-rc.15                                ...           6 years ago
  • 1.0.0-rc.14                                ...           6 years ago
  • 1.0.0-rc.13                                ...           6 years ago
  • 1.0.0-rc.12                                ...           6 years ago
  • 1.0.0-rc.11                                ...           6 years ago
  • 1.0.0-rc.10                                ...           6 years ago
  • 1.0.0-rc.9                                ...           6 years ago
  • 1.0.0-rc.8                                ...           6 years ago
  • 1.0.0-rc.7                                ...           6 years ago
  • 1.0.0-rc.6                                ...           7 years ago
  • 1.0.0-rc.5                                ...           7 years ago
  • 1.0.0-rc.4                                ...           7 years ago
  • 1.0.0-rc.3                                ...           7 years ago
  • 1.0.0-rc.2                                ...           7 years ago
  • 1.0.0-rc.1                                ...           7 years ago
  • 0.15.0-rc.13                                ...           7 years ago
  • 0.15.0-rc.12                                ...           7 years ago
  • 0.15.0-rc.11                                ...           7 years ago
  • 0.15.0-rc.10                                ...           7 years ago
  • 0.15.0-rc.9                                ...           7 years ago
  • 0.15.0-rc.8                                ...           7 years ago
  • 0.15.0-rc.7                                ...           7 years ago
  • 0.15.0-rc.6                                ...           7 years ago
  • 0.15.0-rc.5                                ...           7 years ago
  • 0.15.0-rc.4                                ...           7 years ago
  • 0.15.0-rc.3                                ...           7 years ago
  • 0.15.0-rc.2                                ...           7 years ago
  • 0.15.0-rc.1                                ...           7 years ago
  • 0.15.0-beta.16                                ...           7 years ago
  • 0.15.0-beta.15                                ...           7 years ago
  • 0.15.0-beta.14                                ...           7 years ago
  • 0.15.0-beta.13                                ...           7 years ago
  • 0.15.0-beta.12                                ...           7 years ago
  • 0.15.0-beta.11                                ...           7 years ago
  • 0.15.0-beta.10                                ...           7 years ago
  • 0.15.0-beta.9                                ...           7 years ago
  • 0.15.0-beta.8                                ...           7 years ago
  • 0.15.0-beta.7                                ...           7 years ago
  • 0.15.0-beta.6                                ...           7 years ago
  • 0.15.0-beta.5                                ...           7 years ago
  • 0.15.0-beta.4                                ...           7 years ago
  • 0.15.0-beta.3                                ...           7 years ago
  • 0.15.0-beta.2                                ...           7 years ago
  • 0.15.0-beta.1                                ...           7 years ago
  • 0.15.0-beta.0                                ...           7 years ago
  • 0.14.3                                ...           7 years ago
  • 0.14.2                                ...           7 years ago
  • 0.14.1                                ...           7 years ago
  • 0.14.1-2                                ...           7 years ago
  • 0.14.1-1                                ...           7 years ago
  • 0.14.1-0                                ...           7 years ago
  • 0.14.0                                ...           7 years ago
  • 0.14.0-1                                ...           7 years ago
  • 0.14.0-0                                ...           7 years ago
  • 0.13.4                                ...           7 years ago
  • 0.13.3                                ...           8 years ago
  • 0.13.3-0                                ...           8 years ago
  • 0.13.2                                ...           8 years ago
  • 0.13.1                                ...           8 years ago
  • 0.13.0                                ...           8 years ago
  • 0.13.0-1                                ...           8 years ago
  • 0.13.0-0                                ...           8 years ago
  • 0.12.0                                ...           8 years ago
  • 0.12.0-2                                ...           8 years ago
  • 0.12.0-1                                ...           8 years ago
  • 0.12.0-0                                ...           8 years ago
  • 0.11.9                                ...           8 years ago
  • 0.11.8                                ...           8 years ago
  • 0.11.7                                ...           8 years ago
  • 0.11.6                                ...           8 years ago
  • 0.11.5                                ...           8 years ago
  • 0.11.4                                ...           9 years ago
  • 0.11.3                                ...           9 years ago
  • 0.11.2                                ...           9 years ago
  • 0.11.1                                ...           9 years ago
  • 0.11.0                                ...           9 years ago
  • 0.10.2                                ...           9 years ago
  • 0.10.1                                ...           9 years ago
  • 0.10.0                                ...           9 years ago
  • 0.9.3                                ...           9 years ago
  • 0.9.2                                ...           9 years ago
  • 0.9.1                                ...           9 years ago
  • 0.9.0                                ...           9 years ago
  • 0.8.1                                ...           9 years ago
  • 0.8.0                                ...           9 years ago
  • 0.7.0                                ...           10 years ago
  • 0.6.2                                ...           10 years ago
  • 0.6.1                                ...           10 years ago
  • 0.6.0                                ...           10 years ago
  • 0.5.4                                ...           10 years ago
  • 0.5.3                                ...           10 years ago
  • 0.5.2                                ...           10 years ago
  • 0.5.1                                ...           10 years ago
  • 0.5.0                                ...           10 years ago
  • 0.4.3                                ...           10 years ago
  • 0.4.2                                ...           10 years ago
  • 0.4.1                                ...           10 years ago
  • 0.4.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 10
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (8)
Dev Dependencies (16)

© 2010 - cnpmjs.org x YWFE | Home | YWFE