Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
NPM module patching workflow

NPM module patching workflow

Create a new project

npm init -f

Add a module

npm install --save something

Need to patch module something

npm install --save

git clone ./patched_modules/something

cd ./patched_modules/something

git remote set-url origin

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment