husky
Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)
Last updated a year 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!

Sponsors

Support Husky on Open Collective and have your company logo here (starts from $100/m)

Visit thanks.typicode.com ???? to view all the people supporting husky.

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

Current Tags

  • 2.5.0                                ...           latest (3 hours ago)

116 Versions

  • 2.5.0                                ...           3 hours ago
  • 2.4.1                                ...           13 days ago
  • 2.4.0                                ...           19 days ago
  • 2.3.0                                ...           a month ago
  • 2.2.0                                ...           2 months ago
  • 2.1.0                                ...           2 months ago
  • 2.0.0                                ...           2 months ago
  • 1.3.1                                ...           6 months ago
  • 1.3.0                                ...           6 months ago
  • 1.2.1                                ...           6 months ago
  • 1.2.0                                ...           7 months ago
  • 1.1.4                                ...           7 months ago
  • 1.1.3                                ...           8 months ago
  • 1.1.2                                ...           8 months ago
  • 1.1.1                                ...           9 months ago
  • 1.1.0                                ...           9 months ago
  • 1.0.1                                ...           9 months ago
  • 1.0.0                                ...           9 months ago
  • 1.0.0-rc.15                                ...           9 months ago
  • 1.0.0-rc.14                                ...           9 months ago
  • 1.0.0-rc.13                                ...           a year 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                                ...           2 years ago
  • 0.15.0-beta.15                                ...           2 years ago
  • 0.15.0-beta.14                                ...           2 years 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                                ...           3 years ago
  • 0.12.0-2                                ...           3 years ago
  • 0.12.0-1                                ...           3 years ago
  • 0.12.0-0                                ...           3 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 5,129
This Week 5,129
This Month 75,894
Last Day 1,078
Last Week 24,913
Last Month 98,971
Dependencies (8)
Dev Dependencies (15)
Dependents (936)

Copyright 2014 - 2017 © taobao.org |