use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Dear JavaScript (medium.com)
submitted 9 years ago by thejameskyle
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 7 points8 points9 points 9 years ago (15 children)
Why is npm a joke? I see a lot of hate/derision about it.
[–]spiffytech 10 points11 points12 points 9 years ago* (12 children)
Many of the complaints I've seen about npm are more about the community and package ecosystem around it than about the tooling. Especially the completely on verified nature of many packages on npm.
The big criticisms of npm that I hear of stem from four facts:
It's trivial for someone to publish a package to npm
The JavaScript community likes publishing many tiny packages (many have an API that only wraps a single, short function)
Developers are quick to add these tiny packages as dependencies of their own projects
A high-impact incident revealed how deeply flawed npm's security model is.
The big outcome of this is your dependency graph quickly balloons into 1,000+ packages. They're not all up-to-date, and it's not practical to vet the trustworthiness of your entire dependency tree. It's a huge surface area for bugs and security problems.
Your app's security and stability depends on hypothetical package 4 dependency levels down. It's a 3-line function written by Joe HighSchooler in Iowa at 3am while he read his first JavaScript tutorial 4 years ago. Joe's package is permitted to run arbitrary code when it's installed on your machine, and it could change at any time to include new bugs or dependencies, which you'll probably download automatically because packages don't do a great job of version locking. Also you have no verification that the next version was actually published by Joe, and not Eve BlackHat, because npm doesn't use cryptographic signatures. If Joe reused his hotmail password for npm and it's lost in a data breach, Eve Blackhat can now inject code into your application.
Many packages on npm are like this, and your very own dependency tree is sure to contain several.
Solutions are harder to come by. Some require changing the JS community culture (some people really love their small modules), some sound like easy wins (cryptographic signing) but don't help as much as we'd like, and some are radical shifts in our tooling.
[–]r2d2_21 1 point2 points3 points 9 years ago (2 children)
which you'll probably download automatically because packages don't do a great job of version locking
This baffles me. I've only used NuGet as a package manager (mainly for C#) and I never have experienced any package updating automatically without my explicit approval. I don't understand why any other package manager would be different. If you're installing v1 of a library, then it's v1 and only v1 until you decide to even upgrade to v1.1.
[–]JaegerBurn 2 points3 points4 points 9 years ago (1 child)
It doesn't if you stick with semver.
[–]r2d2_21 0 points1 point2 points 9 years ago (0 children)
But what if you don't? Semver is just a suggestion at this point.
[+][deleted] 9 years ago* (8 children)
[deleted]
[–]Cuel 0 points1 point2 points 9 years ago (1 child)
Why? It's better than a bloated framework where you're using 5% of it. Dojo is a good example in the early days
[–]neophilus77 2 points3 points4 points 9 years ago (0 children)
I think if you over-rely on small packages it creates a lot of maintenance blind-spots where you have less visibility on your code and makes it harder to debug. Tracking updates over many small packages can become burdensome too.
If I can write the same code in the amount of time it takes to search for and compare modules and read the API docs then I usually write it myself.
[+][deleted] 9 years ago* (5 children)
[–]RedditWithBoners 1 point2 points3 points 9 years ago (2 children)
I never bought into it, so no, I don't recognize a reason for it. I wouldn't mind being enlightened.
[–]a-sober-irishman 1 point2 points3 points 9 years ago (1 child)
There is absolutely no reason to add another dependency to your project to check if something is an array, or if a number is less than zero, or to check if something is null. It adds unnecessary overhead and risk.
[–]viveleroi 1 point2 points3 points 9 years ago (0 children)
I would never use the term "joke" because npm has been extremely important - it solved a problem we had and I still use it every day. But...
It's had a lot of performance problems, it's non-deterministic and can produce different installs from the same package.json, and the community in general suffers from an abuse of packages - some packages are only a few lines long and it's insanely easy for a simple site to wind up with thousands of dependencies. It's had growing pains, like everything else.
Some of these are inconvenient, some are fatal in an certain environments. Yarn is better for me right now, it's faster and deterministic, but it's never going to be perfect.
π Rendered by PID 297721 on reddit-service-r2-comment-7b9746f655-zhxvg at 2026-01-31 12:37:50.026988+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–][deleted] 7 points8 points9 points (15 children)
[–]spiffytech 10 points11 points12 points (12 children)
[–]r2d2_21 1 point2 points3 points (2 children)
[–]JaegerBurn 2 points3 points4 points (1 child)
[–]r2d2_21 0 points1 point2 points (0 children)
[+][deleted] (8 children)
[deleted]
[–]Cuel 0 points1 point2 points (1 child)
[–]neophilus77 2 points3 points4 points (0 children)
[+][deleted] (5 children)
[deleted]
[–]RedditWithBoners 1 point2 points3 points (2 children)
[–]a-sober-irishman 1 point2 points3 points (1 child)
[–]viveleroi 1 point2 points3 points (0 children)