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

Announcement: Husky is on Open Collective ????


Husky

Financial Contributors on Open Collective Mac/Linux Build Status Windows Build status

Git hooks made easy

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

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

Git hooks installed by husky will be removed.

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

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

Patreon

People and companies supporting via Patreon: thanks

License

MIT

Current Tags

  • 3.0.1                                ...           latest (5 days ago)

121 Versions

  • 3.0.1                                ...           5 days ago
  • 3.0.0                                ...           22 days ago
  • 3.0.0-0                                ...           a month ago
  • 2.7.0                                ...           a month ago
  • 2.6.0                                ...           a month ago
  • 2.5.0                                ...           a month ago
  • 2.4.1                                ...           a month ago
  • 2.4.0                                ...           2 months ago
  • 2.3.0                                ...           2 months ago
  • 2.2.0                                ...           3 months ago
  • 2.1.0                                ...           3 months ago
  • 2.0.0                                ...           3 months ago
  • 1.3.1                                ...           7 months ago
  • 1.3.0                                ...           7 months ago
  • 1.2.1                                ...           7 months ago
  • 1.2.0                                ...           8 months ago
  • 1.1.4                                ...           8 months ago
  • 1.1.3                                ...           9 months ago
  • 1.1.2                                ...           9 months ago
  • 1.1.1                                ...           10 months ago
  • 1.1.0                                ...           10 months ago
  • 1.0.1                                ...           10 months ago
  • 1.0.0                                ...           10 months ago
  • 1.0.0-rc.15                                ...           10 months ago
  • 1.0.0-rc.14                                ...           10 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                                ...           2 years ago
  • 0.15.0-rc.2                                ...           2 years ago
  • 0.15.0-rc.1                                ...           2 years 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                                ...           3 years ago
  • 0.13.0                                ...           3 years ago
  • 0.13.0-1                                ...           3 years ago
  • 0.13.0-0                                ...           3 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 216
This Week 10,459
This Month 91,373
Last Day 5,100
Last Week 27,676
Last Month 98,843
Dependencies (11)
Dev Dependencies (22)
Dependents (981)

Copyright 2014 - 2016 © taobao.org |