13
HelpMe
1y

People use this to argue why node is better. I instead use it to show why node sucks. More is less. Be ready for 3gb node_modules.

Comments
  • 6
    JS is special, for multiple reasons:
    - no STL means packages need to do everything
    - binary size is among the most important performance metrics and all the others are highly abstract
    - tree-shaking means that you can import a 2GB package and use a three lines long function. If someone else in the dependency tree used the same function, you saved three lines from the final binary size
  • 7
    what happened in 2019?
  • 5
    @lbfalvy for production sure.
    For dev you need a 1TB hard drive at minimum these days to work with npm and the spawn of files.
  • 2
    Good god! This looks like the plot of the size of our universe during the cosmic inflation phase!
  • 4
    In 2030:
    "Scientists estimate that there are now more node modules than particles in the observable universe"
  • 4
    The way to not use a million node modules is to be selective about what gets into the project. I had a project where the original devs believed “we shouldn’t write anything if there is a library to do it”. That was insane.

    We had express middleware imported for permissions. They used one thing from it which was a wrapper around Array.prototype.includes().
  • 4
    I looked into react the other day

    800 modules for hello-world
  • 0
    @C0D4 I have a 1TB drive, and I'd much rather assume that all other devs do too than sacrifice even just 1kB of visitor bandwidth.

    JS frameworks can and do save bandwidth while also adding flashy and unnecessary UI features and genuine quality of life improvements, you just need to execute some 50 steps perfectly to compose your own toolchain or use a metaframework such as Next and submit your dev hours to dependency hell.
  • 0
    It's not a good situation but not as bad as people like to make it out to be. You can avoid any of JS' problems at the cost of others.
  • 1
    On the other hand, it's primarily a compatibility standard between web browsers so if you think you can deliver better bundle sizes and first render times with some other language transpiled to WASM or JS without carrying over the inherent problems then by all means go for it.
  • 0
    @lbfalvy that’s what it should be (and probably will be in the future).
  • 1
    The graph is also wrong. CPAN for example has more than 250000 according to the graph looks more like 15000.
Add Comment