Skip to content

Instantly share code, notes, and snippets.

@vjpr vjpr/README.md
Last active Aug 29, 2015

Embed
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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.