Re:Self Propagating NPM Malware Compromises over 40 Packages
by cluckindan on Wednesday September 17, 2025 @11:38AM
(#45277142)
I guess that pre-installation tree shaking in this case is installing ’lodash.difference’ instead of ’lodash’. :)
Tree shaking however, will not help you, if you have to first install a library using NPM. It will only help you reduce overhead in the code served to a browser. Malicious code can run much earlier, and would be avoided, if you rewrite or extract relevant code from a library, avoiding to install the library using NPM. Or is there some pre-installation tree shaking, that I am unaware of? That would actually be interesting.