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

husky

Git hooks made easy

Mac/Linux Build Status Windows Build status

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

Support

If Husky is saving you time, please consider supporting its development on Patreon ???? thank you!

Install

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

To go further, see the docs here.

Uninstall

npm uninstall husky

Upgrading from 0.14

Simply move your existing hooks to husky.hooks field and use raw Git hooks names. Also, if you're using the GIT_PARAMS env variable, rename it to HUSKY_GIT_PARAMS.

{
  "scripts": {
-   "precommit": "npm test",
-   "commitmsg": "commitlint -E GIT_PARAMS"
  },
+ "husky": {
+   "hooks": {
+     "pre-commit": "npm test",
+     "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
+   }
+ }
}

Alternatively, you can run the following command which will do the same automatically for you ;)

./node_modules/.bin/husky-upgrade

Starting with 1.0.0, you can also configure hooks using .huskyrc, .huskyrc.json or .huskyrc.js file.

// .huskyrc
{
  "hooks": {
    "pre-commit": "npm test"
  }
}

To view the full list of changes, please see the CHANGELOG.

Features

  • Keeps existing user hooks
  • Supports GUI Git clients
  • Supports all Git hooks (pre-commit, pre-push, ...)

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
  • pinst - dev only postinstall hook

License

MIT

Patreon - Supporters

Current Tags

  • 1.3.1                                ...           latest (3 months ago)

109 Versions

  • 1.3.1                                ...           3 months ago
  • 1.3.0                                ...           3 months ago
  • 1.2.1                                ...           3 months ago
  • 1.2.0                                ...           4 months ago
  • 1.1.4                                ...           4 months ago
  • 1.1.3                                ...           5 months ago
  • 1.1.2                                ...           5 months ago
  • 1.1.1                                ...           6 months ago
  • 1.1.0                                ...           6 months ago
  • 1.0.1                                ...           6 months ago
  • 1.0.0                                ...           6 months ago
  • 1.0.0-rc.15                                ...           6 months ago
  • 1.0.0-rc.14                                ...           6 months ago
  • 1.0.0-rc.13                                ...           9 months ago
  • 1.0.0-rc.12                                ...           9 months ago
  • 1.0.0-rc.11                                ...           9 months ago
  • 1.0.0-rc.10                                ...           9 months ago
  • 1.0.0-rc.9                                ...           9 months ago
  • 1.0.0-rc.8                                ...           10 months ago
  • 1.0.0-rc.7                                ...           10 months ago
  • 1.0.0-rc.6                                ...           10 months ago
  • 1.0.0-rc.5                                ...           10 months ago
  • 1.0.0-rc.4                                ...           a year ago
  • 1.0.0-rc.3                                ...           a year ago
  • 1.0.0-rc.2                                ...           a year ago
  • 1.0.0-rc.1                                ...           a year ago
  • 0.15.0-rc.13                                ...           a year ago
  • 0.15.0-rc.12                                ...           a year ago
  • 0.15.0-rc.11                                ...           a year ago
  • 0.15.0-rc.10                                ...           a year ago
  • 0.15.0-rc.9                                ...           a year ago
  • 0.15.0-rc.8                                ...           a year ago
  • 0.15.0-rc.7                                ...           a year ago
  • 0.15.0-rc.6                                ...           a year ago
  • 0.15.0-rc.5                                ...           a year ago
  • 0.15.0-rc.4                                ...           a year ago
  • 0.15.0-rc.3                                ...           a year ago
  • 0.15.0-rc.2                                ...           a year ago
  • 0.15.0-rc.1                                ...           a year ago
  • 0.15.0-beta.16                                ...           a year ago
  • 0.15.0-beta.15                                ...           a year ago
  • 0.15.0-beta.14                                ...           a year ago
  • 0.15.0-beta.13                                ...           a year ago
  • 0.15.0-beta.12                                ...           a year ago
  • 0.15.0-beta.11                                ...           a year ago
  • 0.15.0-beta.10                                ...           a year ago
  • 0.15.0-beta.9                                ...           a year ago
  • 0.15.0-beta.8                                ...           a year ago
  • 0.15.0-beta.7                                ...           a year ago
  • 0.15.0-beta.6                                ...           a year ago
  • 0.15.0-beta.5                                ...           a year ago
  • 0.15.0-beta.4                                ...           a year ago
  • 0.15.0-beta.3                                ...           a year ago
  • 0.15.0-beta.2                                ...           a year ago
  • 0.15.0-beta.1                                ...           a year ago
  • 0.15.0-beta.0                                ...           a year ago
  • 0.14.3                                ...           2 years ago
  • 0.14.2                                ...           2 years ago
  • 0.14.1                                ...           2 years ago
  • 0.14.1-2                                ...           2 years ago
  • 0.14.1-1                                ...           2 years ago
  • 0.14.1-0                                ...           2 years ago
  • 0.14.0                                ...           2 years ago
  • 0.14.0-1                                ...           2 years ago
  • 0.14.0-0                                ...           2 years ago
  • 0.13.4                                ...           2 years ago
  • 0.13.3                                ...           2 years ago
  • 0.13.3-0                                ...           2 years ago
  • 0.13.2                                ...           2 years ago
  • 0.13.1                                ...           2 years ago
  • 0.13.0                                ...           2 years ago
  • 0.13.0-1                                ...           2 years ago
  • 0.13.0-0                                ...           2 years ago
  • 0.12.0                                ...           2 years ago
  • 0.12.0-2                                ...           2 years ago
  • 0.12.0-1                                ...           2 years ago
  • 0.12.0-0                                ...           2 years ago
  • 0.11.9                                ...           2 years ago
  • 0.11.8                                ...           3 years ago
  • 0.11.7                                ...           3 years ago
  • 0.11.6                                ...           3 years ago
  • 0.11.5                                ...           3 years ago
  • 0.11.4                                ...           3 years ago
  • 0.11.3                                ...           3 years ago
  • 0.11.2                                ...           3 years ago
  • 0.11.1                                ...           3 years ago
  • 0.11.0                                ...           3 years ago
  • 0.10.2                                ...           3 years ago
  • 0.10.1                                ...           4 years ago
  • 0.10.0                                ...           4 years ago
  • 0.9.3                                ...           4 years ago
  • 0.9.2                                ...           4 years ago
  • 0.9.1                                ...           4 years ago
  • 0.9.0                                ...           4 years ago
  • 0.8.1                                ...           4 years ago
  • 0.8.0                                ...           4 years ago
  • 0.7.0                                ...           4 years ago
  • 0.6.2                                ...           4 years ago
  • 0.6.1                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.4                                ...           5 years ago
  • 0.5.3                                ...           5 years ago
  • 0.5.2                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.3                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 55
This Week 55
This Month 70,631
Last Day 803
Last Week 22,808
Last Month 49,293
Dependencies (10)
Dev Dependencies (20)
Dependents (792)

Copyright 2014 - 2016 © taobao.org |