git-checkout.js
Imagine you have two branches with different dependency versions. Every time you checkout the other branch you have to
execute npm install
again. This package automates that. It compares both packages.json
files before and after the
checkout and if there is a difference it removes the node_modules
directory and installs the dependencies.
One particular use case would be upgrading one of your heavy dependencies like express inside a dedicated branch. To continue your work on other branches, you need the old express dependency. This package makes it easy to switch between them.
Installation
$ npm install git-checkout.js --save-dev
Usage
Script
Inside your package.json
, add the following to scripts
.
"checkout": "NODE_PATH=. node ./node_modules/git-checkout.js/src/index.js"
Execution
Now you can checkout your branch with:
$ npm run checkout my-branch
Author
Julian Claus and contributors.
License
MIT