I skimmed this HN discussion attached to David Haney’s NPM & left-pad: Have We Forgotten How To Program? post, but it appeared to quickly devolve. The original article is well written but misses one of the key ideas of NPM.
Tiny NPM modules are not useless.
Anyone who’s ever written more than three programs has almost certainly refactored something out into a shared library. Even if it’s just copy and paste, code was reused. DRY (Don’t Repeat Yourself) is not just a mantra, it’s common sense.
The huge innovation NPM enables, and the fuel of JavaScript’s insane innovation engine, is that people started publishing all those tiny libraries and functions as shareable modules. Suddenly one person’s back-pocket toolkit is used and vetted by tens of thousands of eyes. Ideal solutions quickly bubble up. Bugs are isolated and edge cases are corrected.
NPM is a social network.
Those five “eyes closed” minutes Haney says could have been spent writing our own functions instead gets focused on more interesting parts of the project.
While admittedly immature at times, the JavaScript ecosystem is insanely altruistic and open. Batteries may not be included, but if you’re in need, hundreds of people are more than happy to give you theirs.
This whole, latest, node/NPM drama scares me, but the saying “never bet against JavaScript” is true. As soon as it broke, people started fixing it. The term “patch” is completely appropriate here. After a day or two, I expect everything will be working smoothly again.