Comment by evanjrowley
1 hour ago
Why is the Node ecosystem like this? Why do people continue to choose it for popular projects vs. anything else?
1 hour ago
Why is the Node ecosystem like this? Why do people continue to choose it for popular projects vs. anything else?
Because it's written in Javascript and there are classes of highly-situational and not-especially-meaningful vulnerabilities that broadly impact the entire ecosystem ("prototype pollution" is the canonical example) that get counted individually in every occurrence in every NPM package.
It's not a real number, and, worse, it obscures the real figure of merit (/demerit). The Node ecosystem does have a real problem with its culture of sprawling dependencies. But it's not the first-order issue with this "1400" number.
It's the opposite of NIH syndrome. Need to left pad a string? Just import a library from some rando on the internet!
When node was new there were many browsers (different rendering and js engines, not just chrome reskins) and standards and "proto standards" were moving very fast. Different browsers and versions would have very different support for CSS directives, tag behavior, etc. This was a real pain in the ass to make a site consistent across different browsers - every other line of code would require a full switch statement based on browser and version it seemed, and all of these things would need updating every time some browser had an update.
The answer to this was something called polyfills, a library that did something as simple as element.center() with just 500 lines of code to make it consistent on all browsers, and all the places you want to center that element are updated by the polyfill authors and your code doesn't need to be touched.
All the sites that weren't using good polyfills broke (or at least looked terrible) for days every time there was a new $browser update.
Since thats the javascript environment node was born into, the style was carried over by inertia and habit, for better and worse.
Primarily because of the original sin of JS being an awfully designed language. Partially because it's the most popular.
Because it's written by a type of dev that thinks everything should use JS because that's what they used for 6 months while working at a FAANG company before getting laid off and since they worked at a FAANG company clearly they know better than you so if you attack them for using an extremely poor language you just aren't a seriously person so please shut up while I go fishing for some VC funds.
It's like asking why Claude Code is written with react, because the devs getting paid >$500k a year clearly know better d'uh.
Because, like it or not, it does Write Once, Use Anywhere better than Java ever did.
It is pretty much the lowest common denominator for code.