Run script from package upon its installation

I’m experimenting with a method of bundling that requires no alternative module formats to be shipped (published to NPM) alongside my source code. I’m wondering if there’s a way to add some kind of an install hook to my package? I understand this might be a security vulnerability… but it would be super useful to allow packages to––upon their installation––execute some code scoped to their directory within node_modules. Is this doable by any means?

Thank you for reading this through!!!

Kind regards,


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.