Yarn

Huh?
What is it good for?

What's Yarn?

  • package manager for JavaScript

  • replacement for npm

  • developed by Facebook, Google and others

Why Yarn?

  • 🔎 more precise ("secure") version management

  • 🐎 faster than npm (installation speed)

  • 🤖 entirely compatible with our current workflow

  • 💅🏽 cleaner (and prettier!) log output than npm

Yarn installation

​brew update
brew install yarn
yarn --version

or

npm install yarn --global

Yarn's commands

npm init
npm install
npm install <package>
npm uninstall <package>
npm run watch
npm run publish

yarn init
yarn (or yarn install)
yarn add <package>
yarn remove <package>
yarn run watch
yarn run publish

Yarn updates your
package.json
automatically!

Yarn's commands

yarn upgrade <package>

Install newer versions via:

yarn upgrade-interactive

What else is new?

  • yarn.lock file (please check into git)

One quirk…

  • watch out for git-based packages:

Can I still use npm?

Yes.

… but please give Yarn a try!

One more thing…

Yarn has its own package directory:

https://yarnpkg.com/en/packages

Danke.

Thanks.

آپ کا شکریہ

 

Yarn

By Sebastian Herrmann

Yarn

Yarn != Yawn!

  • 1,816