Skip to content

Run `yarn install` or `npm install` on git hooks

License

Notifications You must be signed in to change notification settings

zkochan/yarnhook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yarnhook npm version

yarnhook

yarnhook keeps your node_modules up-to-date when your yarn.lock or package-lock.json changes due to git operations like checkout, merge, rebase, pull etc.

Installation

This package should be used with husky.

yarn add --dev yarnhook husky
# or
npm install --save-dev yarnhook husky

Usage

You should let yarnhook handle git hooks that change the dependencies. Example package.json is as follows:

{
  "scripts": {
    "postmerge": "yarnhook",
    "postcheckout": "yarnhook",
    "postrewrite": "yarnhook"
  }
}

Flags

Prepend YARNHOOK_BYPASS=true to your git command if you don't want to run yarn install or npm install as a result, YARNHOOK_DEBUG=true to print debug information.

An example:

YARNHOOK_BYPASS=true git checkout feature-branch

Artwork

Project logo: @anilkilic

Font: PT Sans

About

Run `yarn install` or `npm install` on git hooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%