If you someone made a concerted effort to put malware in a low level npm package, how hard would it be to detect?
Worryingly, it would be really difficult.
npm based projects make it really easy to factor out individual general-purpose functions as packages.
It's a really nice way to work. Separate packages get their own README, and the combined project is smaller and easier to reason about.
When you install a package with npm, it reports "added M packages by N contributors". This is really helpful metric!
Sometimes I split up my packages into several subpackages, but you still only have to trust me. The number of contributors is often more important.