Yarn

Fast, reliable, and secure dependency management

Yarn Overview

Yarn is a package manager for your code. It allows you to use and share code with other developers from around the world. Yarn does this quickly, securely, and reliably so you don't ever have to worry.

Developer

Facebook, Google, Exponent, and Tilde

Initial release

October 11, 2016

Written in

JavaScript

License

BSD 2-Clause

Key Features

Installation & Setup

Installation Steps:

  1. Install Node.js (which includes npm) from official website
  2. Install Yarn globally via npm: npm install -g yarn
  3. Verify installation with: yarn --version
  4. Initialize a new project with: yarn init
  5. Start adding dependencies with: yarn add [package]

Common Commands:

yarn install

Install all project dependencies

yarn add

Add a dependency to your project

yarn upgrade

Upgrade dependencies to their latest version

yarn workspace

Manage workspace packages

Productivity Tips

Selective Version Resolution

Force specific versions of transitive dependencies in package.json.

Workspaces

Use Yarn workspaces to manage monorepos with multiple packages.

Offline Mirror

Configure an offline mirror for CI/CD environments.

Plug'n'Play

Enable PnP for faster installs and smaller node_modules.

Learning Resources