Overview
Yarn is a node package manager for your code that is better than npm or bower. Yarn is created by Facebook in collaboration with Google, Exponent, and Tilde.
Benefits
- Faster than npm. It is around 3 to 4 times faster than npm without any cache. It downloads the dependencies in parallel. It is much faster once it is cached. https://www.youtube.com/watch?v=yksxtxqORvY
- Deterministic. It will install the same consistent reproducable package dependencies and versions. npm depends on the install order and is non-deterministic (it may download a new minor or patch version) which could break your project.
- Works offline
- Supports other repos/formats
- Backward compatible to npm.
- Has Emojies 😎
Setup
Install Yarn
https://yarnpkg.com/en/docs/install OR npm install -g yarn
yarn config set proxy http://username:password@yourproxyserver:8080/
yarn config set https-proxy http://username:password@yourproxyserver:8080/
Change Angular CLI to use yarn
ng set = --global packageManager=yarn
Documentation
https://yarnpkg.com/en/docs
https://yarnpkg.com/en/docs
Migrating from npm. Run this in your project directory.
yarn
yarn
Videos
Chris Courses: Intro to Yarn
https://www.youtube.com/watch?v=7n467QmiANM
https://www.youtube.com/watch?v=7n467QmiANM
npm vs Yarn
https://www.youtube.com/watch?v=hMk_9RjX5KE
https://www.youtube.com/watch?v=hMk_9RjX5KE
Coding The Smart Way: Yarn Package Manager
https://www.youtube.com/watch?v=6JxSYFnW4rc
https://www.youtube.com/watch?v=6JxSYFnW4rc
Tuitorials
Yarn vs npm
https://www.sitepoint.com/yarn-vs-npm/
https://www.sitepoint.com/yarn-vs-npm/
Yarn Package Manager: An Improvement over npm
https://scotch.io/tutorials/yarn-package-manager-an-improvement-over-npm
https://scotch.io/tutorials/yarn-package-manager-an-improvement-over-npm
No comments:
Post a Comment