husky
Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)
Last updated 9 days 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 (or your team) time, please consider supporting it on Patreon ???? thank you!

Sponsors

Support Husky and be the first to have your company logo here ;)

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.

Note: there's a known issue with Node v12.0, please use v12.1 or higher.

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

  • 2.3.0                                ...           latest (9 days ago)

113 Versions

  • 2.3.0                                ...           9 days ago
  • 2.2.0                                ...           22 days ago
  • 2.1.0                                ...           a month ago
  • 2.0.0                                ...           a month ago
  • 1.3.1                                ...           5 months ago
  • 1.3.0                                ...           5 months ago
  • 1.2.1                                ...           5 months ago
  • 1.2.0                                ...           6 months ago
  • 1.1.4                                ...           6 months ago
  • 1.1.3                                ...           7 months ago
  • 1.1.2                                ...           7 months ago
  • 1.1.1                                ...           8 months ago
  • 1.1.0                                ...           8 months ago
  • 1.0.1                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
  • 1.0.0-rc.15                                ...           8 months ago
  • 1.0.0-rc.14                                ...           8 months ago
  • 1.0.0-rc.13                                ...           10 months ago
  • 1.0.0-rc.12                                ...           a year ago
  • 1.0.0-rc.11                                ...           a year ago
  • 1.0.0-rc.10                                ...           a year ago
  • 1.0.0-rc.9                                ...           a year ago
  • 1.0.0-rc.8                                ...           a year ago
  • 1.0.0-rc.7                                ...           a year ago
  • 1.0.0-rc.6                                ...           a year ago
  • 1.0.0-rc.5                                ...           a year 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                                ...           2 years ago
  • 0.15.0-beta.12                                ...           2 years ago
  • 0.15.0-beta.11                                ...           2 years ago
  • 0.15.0-beta.10                                ...           2 years ago
  • 0.15.0-beta.9                                ...           2 years ago
  • 0.15.0-beta.8                                ...           2 years ago
  • 0.15.0-beta.7                                ...           2 years ago
  • 0.15.0-beta.6                                ...           2 years ago
  • 0.15.0-beta.5                                ...           2 years ago
  • 0.15.0-beta.4                                ...           2 years ago
  • 0.15.0-beta.3                                ...           2 years ago
  • 0.15.0-beta.2                                ...           2 years ago
  • 0.15.0-beta.1                                ...           2 years ago
  • 0.15.0-beta.0                                ...           2 years 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                                ...           3 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                                ...           4 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                                ...           5 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 380
This Week 17,156
This Month 71,213
Last Day 4,405
Last Week 24,028
Last Month 92,461
Dependencies (10)
Dev Dependencies (23)
Dependents (875)

Copyright 2014 - 2016 © taobao.org |