I'd like to extend the npm package "truffle", but currently in version 4 (and version 5), "truffle" doesn't have a plugin extension mechanism.
So the broad question is how to "monkey patch" that. One possiblity would be to list the truffle package as a dependancy and then run some shell commands like "patch" to modify truffle which is generally installed in node_modules.
Does npm have a way where I could run such shell commands after node dependencies are successfuly installed?
Any other suggestions? (Another method might be monkey patching at the nodejs level, but I think that will be more cumbersome.)
EDIT
The postinstall field of scripts in the package.json may be what I am looking for.
In the end we used patch-package
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With