Given that these attacks are becoming increasingly common, package registries could at least install each package (prior to publishing) in some isolated container or VM and then run some similar malware detection on the resulting file system.
Honestly, I'm strongly considering moving away from the NPM ecosystem because it's clearly become a target for malware.
Honestly, I'm strongly considering moving away from the NPM ecosystem because it's clearly become a target for malware.