Create a new project
npm init -f
Add a module
npm install --save something
Need to patch module something
npm install --save https://github.com/something/something.git
git clone https://github.com/something/something ./patched_modules/something
cd ./patched_modules/something
git remote set-url origin https://github.com/USERNAME/something
npm link ./patched_modules/something
Make changes to ./patched_modules/something
.
cd ./patched_modules/something
git commit -m 'fixed'
git push
cd ../
git push
-> A pre-push hook (I will post separately) looks for symlinked node_modules
and updates the package.json
with the latest pushed commit hash.
`git commit -m 'Update package.json git dependencies'
git push
git push heroku master
-> Deploys and uses your git dependencies. Because they use commit hashes (instead of tags or branches or something), they are cached.