Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Yarn

Artur
January 26, 2017

 Yarn

Intro into Yarn 🧶 the package manager

Artur

January 26, 2017
Tweet

More Decks by Artur

Other Decks in Programming

Transcript

  1. Fast: Yarn caches every package it downloads so it never

    needs to download the same package again. It also parallelizes operations to maximize resource utilization so install times are faster than ever.
  2. Reliable: Using a detailed, concise lockfile format and a deterministic

    algorithm for installs, Yarn is able to guarantee that an install that worked on one system will work exactly the same way on any other system.
  3. Secure: Yarn uses checksums to verify the integrity of every

    installed package before its code is executed.
  4. • Offline Mode. If you've installed a package before, you

    can install it again without any internet connection. • Deterministic. The same dependencies will be installed in the same exact way on any machine, regardless of install order. • Network Performance. Yarn efficiently queues up requests and avoids request waterfalls in order to maximize network utilization. • Network Resilience. A single request failing won't cause an install to fail. Requests are retried upon failure. • Flat Mode. Yarn resolves mismatched versions of dependencies to a single version to avoid creating duplicates. Features
  5. CLI commands npm-shrinkwrap.json === yarn.lock *required They both are used

    to lock down dependency versions, by storing the exact versions of each dependency for your package. npm install === yarn
  6. CLI commands npm install gulp --save === yarn add gulp

    npm uninstall taco --save === yarn remove taco npm install taco --save-dev === yarn add taco --dev npm install taco --global === yarn global add taco
  7. CLI commands npm init === yarn init npm link ===

    yarn link npm outdated === yarn outdated npm publish === yarn publish
  8. CLI commands npm run === yarn run npm cache clean

    === yarn cache clean npm login === yarn login (and logout) npm test === yarn test npm install --production === yarn --production
  9. CLI commands • yarn licenses ls  —  List licenses for

    installed packages. • yarn licenses generate-disclaimer  —  List of licenses from all the installed packages. • yarn pack — Make a gzip archive of package dependencies. • yarn self-update  — Updates Yarn to the latest version. • yarn why  — Show information about why a package is installed. • yarn upgrade-interactive
  10. Excited to to recommend the @yarnpkg JS package manager npm

    install – 2m5s yarn (no cache) – 9s yarn (cache) – 2s @Yeoman How fast it is? More => yarnpkg.com/en/compare