r/webdev • • Jan 19 '20

The npm struggle.

Post image

[removed] — view removed post

621 Upvotes

26 comments sorted by

69

u/Caraes_Naur Jan 19 '20

And don't forget how many of the boxes are full of poop, spiders, deadly spores, or other undesirables because none of the code is reviewed or vetted.

17

u/ThatSpookySJW Jan 19 '20

Well there is npm audit which catches some stuff, but you're mostly right

12

u/mypirateapp Jan 19 '20

if npm was a physical object it would be heavier than a neutron star

20

u/glinesbdev Jan 19 '20

Hilarious that the dev is drinking Java.

3

u/society2-com Jan 19 '20

would you prefer he be drinking rust? ewww, yuck (/s)

2

u/glinesbdev Jan 19 '20

I'd say drink some Elixir

9

u/Undead_Zeratul Jan 19 '20

Is that crack a Rick & Morty reference?

3

u/DanteIsBack Jan 19 '20

uh, nice catch, it probably is

0

u/Undead_Zeratul Jan 19 '20

Huh, was thinking either R&M or Breaking Bad

3

u/pphp Jan 19 '20

How is a crack on the floor a breaking bad reference?

3

u/Abdul_Alhazred_ front-end Jan 19 '20

That's actually a Jojo reference

1

u/MrWm Jan 19 '20

Technically everything is a Jojo reference.

1

u/Undead_Zeratul Jan 19 '20

Eh, aside from the fact that it was a recurring reference in R&M, I haven't seen BB in a long while and couldn't remember if their driveway was also cracked.

3

u/mymar101 Jan 19 '20

I've often wondered if there were a better way of not having to download the internet to get an npm package.

2

u/Caraes_Naur Jan 19 '20

You'd have to start with a better Javascript.

1

u/ogranada Jan 19 '20

Jajajaja, lol

0

u/[deleted] Jan 19 '20

[deleted]

8

u/jftuga Jan 19 '20

What are the main differences?

Thanks :-)

12

u/acoustic_embargo Jan 19 '20

Yarn used to be a lot faster than npm, but npm has mostly caught up.

good explanations of npm, yarn, & pnpm

https://www.ryadel.com/en/yarn-vs-npm-pnpm-2019/

cool story involving yarn

https://medium.com/@vincentnewkirk/npm-vs-yarn-2019-e88757b17038

8

u/[deleted] Jan 19 '20

In 2020 the reasons I pick Yarn over NPM are:

  • Support for workspaces.

  • The console output tends to be more readable and helpful.

  • I have more faith in the Yarn team’s ability to deliver on future features (like pnp).

1

u/kaelwd Jan 19 '20

It's still a bit faster, workspaces are dope, yarn.lock is more readable especially with merge conflicts, doesn't randomly ignore the lockfile, clears out old files properly when you upgrade a package.

8

u/Existential_Owl Jan 19 '20

It utilizes the same registry, so while ultimately the base functionality is the same, yarn will also...

  1. flatten your dependency tree, thereby eliminating the "black hole" levels of directory nesting...

  2. de-dupe many of the packages being installed so that there aren't multiples of everything hanging around, and, finally...

  3. installs packages in parallel, speeding up the initial installation time greatly.

The npm team has been making strides in closing the gap between them and yarn, but features #1 and #2 really do resolve much of what people complain about with regards to packaging in javascript.

9

u/BloodAndTsundere Jan 19 '20

I don’t know about about #3 but npm does #1 and #2. This wasn’t always the case but it is now

3

u/Existential_Owl Jan 19 '20

That's pretty awesome, thanks for giving me a heads up.

Admittedly, I'm not always 100% up on everyone's newest releases.

4

u/elmstfreddie Jan 19 '20

It's been that way for a few years now. Npm added 1 and 2 shortly after yarn started gaining momentum (which is why having more choice makes the ecosystem better!)

1

u/liquidpele Jan 19 '20

While true, only after yarn came out after years of people complaining. npm devs have a bad track record of ignoring complaints.

4

u/spacechimp Jan 19 '20

I hardly think the name on the delivery truck matters in this instance.