Dependency is replaced by one-liner, weekly traffic is reduced by 440GB

Aug 1, 2024 · 3:20 PM UTC

This work was powered by package-size-calculator, which allows calculating the size of an NPM package github.com/TheDevMinerTV/pac… Developed by the e18e community chat.e18e.dev
1
1
12
Replying to @andrey_akinshin
My question is, how a lib with one simple typecheck had so many updates, that it ended up with version 7.0.0
20
7
1,406
Replying to @andrey_akinshin
Looks like someone’s going to exceed expectations on the next performance review cycle
4
1
431
Replying to @andrey_akinshin
can we pause for one moment to gaze in wonder at how one determines if something is a number in javascript? magnificent.
8
2
1
199
Replying to @andrey_akinshin
THIS is proper software engineering 👏
1
52
Replying to @andrey_akinshin
omg that’s insane. why is that even a package
3
36
Replying to @andrey_akinshin
From a guy called "talentlessguy" lol
1
232
Replying to @andrey_akinshin
That’s amazing. JS insanity.
1
17
Replying to @andrey_akinshin
wtf there's a package for that at version 7, what were the breaking changes lol
1
Replying to @andrey_akinshin
Very, very satisfying. Thank you.
1
Replying to @andrey_akinshin
Node.js. The antithesis of green/ saving electricity. Imagine how much energy we would save without all the npm pull crap
3
1
105
Replying to @andrey_akinshin
This is *literally* all that the module does
6
1
107
Replying to @andrey_akinshin
This is the problem with nodejs, a lot of shitty dependencies.
2
75
Replying to @andrey_akinshin
Fire the person who used it in the first place
4
35
Replying to @andrey_akinshin
I’m just laughing at the GitHub username of the committer. 🤣
24
Replying to @andrey_akinshin
How come? The code itself ~400 bytes, the rest is readme and license, which is not included in bundle
2
23
Replying to @andrey_akinshin
that what happens when u confuse JS for a programming language
2
19
Replying to @andrey_akinshin
My doubt is how come that one package (Including its own name dependencies) could cause this much impact?? Am I missing something?
2
1
17
Replying to @andrey_akinshin
Is this how to correctly check for number in js? That's depressing
2
12
Replying to @andrey_akinshin
Congrats on finding something so simple and powerful.
9
Replying to @andrey_akinshin
Dependencies like that just shouldn’t exist. If it’s simple enough, write it yourself!
9
Replying to @andrey_akinshin
Actually TBH I think the prevalence of these sorts of modules in JavaScript is largely due to the fact that nobody is fully confident they understand all of the weird typing edge cases they need to handle to perform a complicated task like determine whether something is a number
8
Replying to @andrey_akinshin
The first time I heard is-number as a library you install I thought it was a joke.
2
8
Replying to @andrey_akinshin
Why are they downloading packages 40 million times a week? Badly configured CI?
7
Replying to @andrey_akinshin
Without more details this seems wholly inaccurate- what's leading to the high volume? Does the package contain test data with all natural numbers 😂
6
Replying to @andrey_akinshin
Hats off to dev who wrote the package just to check the type and second hats off to dev who used it even 😂
1
5
Replying to @andrey_akinshin
Not a JS developer. But why would you need a “is-number” dependency?
3
5
Replying to @andrey_akinshin
this guy saved a lot of carbon dioxide
5
Replying to @andrey_akinshin
If code was written by the sales department
4
Replying to @andrey_akinshin
The estimation is biaised. It's based on the fact that every download on the lib results on one download of the incriminated lib which is not true : npm cache is machine wide
1
3
Replying to @andrey_akinshin
But how is it that this change saved any traffic at all? The languages I use would compile down this two implementations to the same executable or interpretable code. What is JS doing here?
3
Replying to @andrey_akinshin
I'm still not sure why they're using `v - v === 0` instead of `!Number.isNaN(v)`. That "clever" trick is going to confuse inexperienced devs!
2
3
Replying to @andrey_akinshin
Now let’s rinse and repeat this across the entirety or GitHub and GitLab. Then tackle other similar “libraries”
3
Replying to @andrey_akinshin
Gonna be hilarious when is-number 8.0.0 comes out with new features and you can’t take advantage of them.
3