JSPM

husky

0.15.0-beta.14
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19428011
  • Score
    100M100P100Q215355F
  • License MIT

Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)

Package Exports

  • husky/lib/installer
  • husky/lib/installer/bin
  • husky/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (husky) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

husky npm version Mac/Linux Build Status Windows Build status

Git hooks made easy

beta branch, see master for stable release documentation

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

Install

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

Uninstall

npm uninstall husky

Upgrade

If you're upgrading from 0.14 simply move your hooks to "husky" field.

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

Alternatively, you may 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.

Configure

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.

Features

  • Fast, minimalist and simple
  • Keeps existing user hooks
  • Supports GUI Git clients
  • Supports all Git hooks (pre-commit, pre-push, ...)
  • Supports monorepo/sub-directories layouts
  • If you were using ghooks, it will migrate your Git hooks

Used by

See also

License

MIT - Typicode 🌵 - Patreon