DEV Community


Discussion on: My React stack for 2019

clovis1122 profile image
José Clovis Ramírez de la Rosa

Yarn is much faster
Yarn workspaces allow for easy monorepo management
Yarn has upgrade-interactive. NPM has a separate package for that.

Can you link me to the benchmarks? Much of the posts that I find says that they're par on speed. Just now I tried both a cold install and a warm install inside a Docker container and got these results:

npm cold install: 48s
yarn cold install: 1m12s

npm warm install: 24s
yarn warm install: 20s

Note that for CI environments, npm has npm ci which install the dependencies 3 times faster. I didn't find a yarn equivalent.

About monorepos and upgrade-interactive: I don't use monorepos and I update dependencies like once in a month, so I don't actually mind those features. Like you said there's a separate package for both features so you can do:

npx npm-check --upgrade
npx lerna ...

There's no npx equivalent on Yarn.

Thread Thread
pajasevi profile image
Pavel Ševčík Author

Some recent benchmarks are here. They're on par most of the time, but Yarn is pretty fast with cache and lockfile.

Thread Thread
chibiblasphem profile image
Debove Christopher

Easy to be fast with cache when Yarn cache litterally everything (every month I needed to remove 80GB of data from Yarn cache when i was using it)

By the way npm ci is what you use normally when you're not locally developing on the package so every installation aside your local install is 3x faster.

For mono repo, there's lerna which you can use via npx