What is the best way to edit an NPM package to have my own code but still be updated with the package (But not overwritten, kind of like git merge).
So right now I cloned the Git repo to a folder and in my package-json I declared the dependency to require that folder..
{
"dependency": "file:lib/dependency"
}
And what I also did was add the origin to my personal Git repo and add the upstream as dependency's original repo. The idea here is that when the maintainers update the original repo I can pull the upstream and when I wanna push my personal changed code I can push to origin.
Please let me know what you think of this approach and if there's anything I'm doing wrong or should do different. Thanks in advance.