by jannes · 8y ago · 0 comments
Let's say you want to use webpack and TypeScript on a project: Boom. 425 packages installed. And that's before you have written a single line of code. (It's probably worth noting that the offender is webpack. TypeScript seems to be dependency-free.) [1]
Every single one of those 425 packages could have a malicious postinstall script that deletes your entire home directory or sends your private ssh keys to a remote server.
npm makes it too easy to add dependencies to a library.
[1]: If you also want webpack-cli that's another cool 441 packages for you.
Maybe Code Reuse is not the paradise the software industry has for so long thought it was?
But TypeScript is a positive exception to this trend. It has no (npm) dependencies at all.
Avoiding malicious postinstall scripts is a separate problem that needs to be solved whether you use dependencies for developer tools or not.