Socket
Socket
Sign inDemoInstall

husky

Package Overview
Dependencies
Maintainers
1
Versions
214
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

husky - npm Package Compare versions

Comparing version 0.14.3 to 0.15.0-beta.0

docs.md

14

CHANGELOG.md
# CHANGELOG
## Unreleased
* Support `sendemail-validate` hook [#173](https://github.com/typicode/husky/pull/173)
* Support `HUSKY_SKIP_INSTALL` environment variable for skipping git hooks installation
* Drop `nvm` installed with `brew` support as it's not supported by `nvm` itself (see [creationix/nvm#important-notes](https://github.com/creationix/nvm#important-notes)), `nvm` standard installation is still supported though
## 0.14.3
* Fix PATH export [#150](https://github.com/typicode/husky/pull/114)
* Fix handle space in `PATH` [#150](https://github.com/typicode/husky/pull/114)
## 0.14.2
* Fix When a space was present in `$HOME`, hook script was failing
* Fix handle space in `HOME`
## 0.14.1
* Fix Husky wasn't installing Git hooks on Windows
* Fix When nvm was installed with Brew, hook script was failing
* Fix Git hooks install on Windows
* Fix hook script when `nvm` was installed with Brew

@@ -16,0 +22,0 @@ ## 0.14.0

{
"name": "husky",
"version": "0.14.3",
"version": "0.15.0-beta.0",
"description": "Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)",
"engines": {
"node": ">=4"
},
"scripts": {
"test": "jest",
"format": "prettier --single-quote --no-semi --write **/*.js",
"install": "node ./bin/install.js",
"uninstall": "node ./bin/uninstall.js"
"test": "npm run lint && jest",
"postinstall": "node husky install",
"preuninstall": "node husky uninstall",
"devInstall": "npm run build && node husky-dev install",
"devUninstall": "npm run build && node husky-dev uninstall",
"build": "del-cli lib && tsc",
"prepublishOnly": "npm run test && npm run build && pkg-ok",
"lint": "tslint 'src/**/*.ts'",
"fix": "npm run lint -- --fix"
},
"repository": {
"type": "git",
"url": "git://github.com/typicode/husky.git"
"url": "git+https://github.com/typicode/husky.git"
},

@@ -30,3 +32,4 @@ "keywords": [

"postmerge",
"test"
"test",
"lint"
],

@@ -38,20 +41,43 @@ "author": "Typicode <typicode@gmail.com>",

},
"homepage": "https://github.com/typicode/husky",
"homepage": "https://github.com/typicode/husky#readme",
"dependencies": {
"execa": "^0.8.0",
"pkg-dir": "^2.0.0",
"read-pkg": "^2.0.0",
"run-node": "^0.1.1"
},
"devDependencies": {
"jest": "^20.0.4",
"mkdirp": "^0.5.1",
"prettier": "^1.4.4",
"rimraf": "^2.6.1",
"tempy": "^0.1.0"
"@types/execa": "^0.7.0",
"@types/jest": "^20",
"@types/node": "^8.0.31",
"del": "^3.0.0",
"del-cli": "^1.1.0",
"jest": "^20",
"pkg-ok": "^1.1.0",
"prettier": "^1.7.2",
"tempy": "^0.2.1",
"ts-jest": "^21.0.1",
"tslint": "^5.7.0",
"tslint-config-prettier": "^1.5.0",
"tslint-plugin-prettier": "^1.3.0",
"typescript": "^2.5.3"
},
"dependencies": {
"is-ci": "^1.0.10",
"normalize-path": "^1.0.0",
"strip-indent": "^2.0.0"
"jest": {
"transform": {
"^.+\\.tsx?$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
]
},
"standard": {
"env": {
"jest": true
"husky": {
"hooks": {
"pre-commit": "npm test"
}
}
}
}

@@ -5,2 +5,4 @@ # husky [![](http://img.shields.io/npm/dm/husky.svg?style=flat)](https://www.npmjs.org/package/husky) [![npm version](https://badge.fury.io/js/husky.svg)](https://www.npmjs.com/package/husky) [![Mac/Linux Build Status](https://img.shields.io/travis/typicode/husky/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/typicode/husky) [![Windows Build status](https://img.shields.io/appveyor/ci/typicode/husky/master.svg?label=Windows)](https://ci.appveyor.com/project/typicode/husky/branch/master)

_beta branch, see [master](https://github.com/typicode/husky) for stable release documentation_
Husky can prevent bad commit, push and more :dog: _woof!_

@@ -11,16 +13,14 @@

```sh
npm install husky --save-dev
npm install husky@beta --save-dev
```
```sh
yarn add husky --dev
```
```javascript
// Edit package.json
```js
// package.json
{
"scripts": {
"precommit": "npm test",
"prepush": "npm test",
"...": "..."
"husky": {
"hooks": {
"pre-commit": "npm test",
"pre-push": "npm test",
"...": "..."
}
}

@@ -30,21 +30,6 @@ }

```bash
git commit -m "Keep calm and commit"
```sh
git commit -m 'Keep calm and commit'
```
_Existing hooks aren't replaced and you can use [any Git hook](HOOKS.md)._
_If you're migrating from `ghooks`, simply run `npm uninstall ghooks --save-dev && npm install husky --save-dev` and edit `package.json`. Husky will automatically migrate `ghooks` hooks._
## Used by
* [jQuery](https://github.com/jquery/jquery)
* [Next.js](https://github.com/zeit/next.js)
* [Hyper](https://github.com/zeit/hyper)
* [Paper.js](https://github.com/paperjs/paper.js)
* [Kibana](https://github.com/elastic/kibana)
* [JSON Server](https://github.com/typicode/json-server)
* [Hotel](https://github.com/typicode/hotel)
* ... and over 6000+ [other awesome projects](https://libraries.io/npm/husky/dependent-repositories).
## Uninstall

@@ -56,59 +41,33 @@

```sh
yarn remove husky
```
## Configure
## Tricks
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.
<details>
Check [documentation](DOCS.md) for more.
### Debug hooks easily
## Features
If you need to debug hooks, simply use `npm run <script-name>`. For example:
* 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
```bash
npm run precommit
```
## Used by
### Git GUI clients support
* [jQuery](https://github.com/jquery/jquery)
* [babel](https://github.com/babel/babel)
* [create-react-app](https://github.com/facebookincubator/create-react-app)
* [Next.js](https://github.com/zeit/next.js)
* [Hyper](https://github.com/zeit/hyper)
* [Kibana](https://github.com/elastic/kibana)
* [JSON Server](https://github.com/typicode/json-server)
* [Hotel](https://github.com/typicode/hotel)
* ... and over 10k+ [other awesome repos](https://libraries.io/npm/husky/dependent-repositories).
If you've installed Node using the [standard installer](https://nodejs.org/en/), [nvm](https://github.com/creationix/nvm) or [homebrew](http://brew.sh/), Git hooks will be executed in GUI applications.
### Working with multiple version of Node
If [`nvm`](https://github.com/creationix/nvm) is installed, husky will try to use the `default`/`current` installed Node version or use the project `.nvmrc`.
__Tip__ to use the system-installed version of node, `nvm` provides a [`system`](https://github.com/creationix/nvm#system-version-of-node) alias
### Accessing Git params
Git params can be found in `GIT_PARAMS` environment variable.
### Setting a different log level
By default, husky will run scripts using `--silent` to make the output more readable. If you want to override this, simply pass a different log level to your scripts:
```json
"precommit": "npm run some-script -q"
```
_`-q/--quiet` is equivalent to `--loglevel warn` which is npm default log level._
### Git submodule and subtree support
Yes
### Cygwin support
Yes
### Yarn support
Please use `yarn` `v0.24+`
</details>
## See also
* [pkg-ok](https://github.com/typicode/pkg-ok) - prevents publishing modules with bad paths
* [pkg-ok](https://github.com/typicode/pkg-ok) - Prevents publishing modules with bad paths
* [please-upgrade-node](https://github.com/typicode/please-upgrade-node) - Show a message to upgrade Node instead of a stacktrace in your CLIs
* [react-fake-props](https://github.com/typicode/react-fake-props) - Fake props for your React tests

@@ -115,0 +74,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc