You might argue people are wrong to do that, but the fact is it's extremely popular. And if we redesign the security model, we can allow people to do it safely.
Imagine if leftpad.js had no privileges to anything, even if included in an application that has privileges to network, disk, etc.
In almost any other CS field you would be crazy to use non-vetted third-party code and depend on external service providers for your code to simply run.
I can only think of draconian DRM, which puts things in perspective...
That's why a per-library sandbox model seems so beneficial.
It does still seem dramatically different to need to get an escape out of the js sandbox than to just be handed privileges by design.
Particularly if (in some glorious future) the js vm is written in a safe language, not C++.
Some people are realizing it is not a good idea to download random code. So the solution proposed by Deno is to sandbox it and put a capabilities system into it, rather than create a culture of proper dependency management.
At least they are trying...