Home

Awesome

<p align="center"> <a href="https://yarnpkg.com/"> <img alt="Yarn" src="https://github.com/yarnpkg/assets/blob/master/yarn-kitten-full.png?raw=true" width="546"/> </a> </p> <p align="center"> Fast, reliable, and secure dependency management. </p> <p align="center"> <a href="https://github.com/yarnpkg/berry"><img alt="GitHub Actions status" src="https://github.com/yarnpkg/berry/workflows/Integration/badge.svg"/></a> <a href="https://discord.gg/yarnpkg"><img alt="Discord Chat" src="https://img.shields.io/discord/226791405589233664.svg"/></a> <a href="https://github.com/yarnpkg/berry"><img alt="Latest CLI Release" src="https://img.shields.io/npm/v/@yarnpkg/cli/latest?label=latest"/></a> </p>

Yarn is a modern package manager split into various packages. Its novel architecture allows to do things currently impossible with existing solutions:

Our supports

Gold sponsors

<table width="100%"> <tr> <td> <a href="https://www.doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=yarn&utm_source=github#gh-light-mode-only"> <img src="https://assets.website-files.com/5de9972f49103c5df3964004/5f0c1146992a5e9e4fa553e6_logo.svg" width="140"/> </a> <a href="https://www.doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=yarn&utm_source=github#gh-dark-mode-only"> <img src="https://user-images.githubusercontent.com/1037931/151548177-308f0a41-fb0e-4311-9969-4a2455b08686.svg" width="140"/> </a> </td> <td> <b>All your environment variables, in one place</b>. Stop struggling with scattered API keys, hacking together home-brewed tools, and avoiding access controls. Keep your team and servers in sync with <b><a href="https://www.doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=yarn&utm_source=github">Doppler</a></b>. </td> </tr> <tr> <td> <a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=berry&utm_source=github#gh-light-mode-only"> <img src="https://user-images.githubusercontent.com/1037931/151547094-7aa4a5cb-07e4-4b8a-ab8f-0a15fd63ab7d.svg" width="140"/> </a> <a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=berry&utm_source=github#gh-dark-mode-only"> <img src="https://user-images.githubusercontent.com/1037931/151547899-3655e0d3-3bdb-4351-bd75-af2bebd3ce92.svg" width="140"/> </a> </td> <td> <b>Your app, enterprise-ready</b>. Start selling to enterprise customers with just a few lines of code. Add Single Sign-On (and more) in minutes instead of months with <b><a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=berry&utm_source=github">WorkOS</a></b>. </td> </tr> </table>

But also

<table width="100%"> <tr> <td> <a href="https://www.datadoghq.com/"> <img src="https://user-images.githubusercontent.com/1037931/86770706-62299e00-c051-11ea-931a-2831c894ab6a.png" width="140"/> </a> </td> <td> <b><a href="https://www.datadoghq.com/">Datadog</a></b> has been sponsoring the time of our lead maintainer for more than a year now. They also upgraded our account so that we can benefit from long-term telemetry (<a href="https://github.com/yarnpkg/berry/issues/1250">RFC</a>). </td> </tr> <tr> <td> <a href="https://sysgears.com/"> <img src="https://github.com/yarnpkg/berry/assets/1259926/c4d46d45-4f45-4b20-811e-d1f9d9e452dd" width="140"/> </a> </td> <td> <b><a href="https://sysgears.com/">SysGears</a></b> also sponsored time from very early in the 2.x development. In particular, their strong investment is the reason why Yarn 2 supports node_modules installs even better than it used to. </td> </tr> <tr> <td> <a href="https://www.netlify.com/"> <img src="https://upload.wikimedia.org/wikipedia/commons/b/b8/Netlify_logo.svg" width="140"/> </a> </td> <td> <b><a href="https://www.netlify.com/">Netlify</a></b> has been the historical provider for our website. Each time we got issues, they jumped to our help. Their live previews have been super helpful in our development process. </td> </tr> <tr> <td> <a href="https://www.cloudflare.com/"> <img src="https://user-images.githubusercontent.com/1037931/86770912-bc2a6380-c051-11ea-9f99-97161b2d7cf2.png" width="140"/> </a> </td> <td> <b><a href="https://www.cloudflare.com/">Cloudflare</a></b> has also been a historical partner. While we don't directly mirror the npm registry anymore, they still power our website to make its delivery as fast as possible. </td> </tr> <tr> <td> <a href="https://www.algolia.com/"> <img src="https://upload.wikimedia.org/wikipedia/commons/d/da/Algolia_logo.svg" width="140"/> </a> </td> <td> <b><a href="https://www.algolia.com/">Algolia</a></b> contributed a lot to our documentation over the years. They still power the search engine we use on both versions of the documentation. </td> </tr> </table>

Installation

Consult the Installation Guide.

Migration

Consult the Migration Guide.

Documentation

The documentation can be found at yarnpkg.com.

API

The API documentation can be found at yarnpkg.com/api.

Current status

On top of our classic integration tests, we also run Yarn every day against the latest versions of the toolchains used by our community - just in case. Everything should be green!

<!-- Generated by running "node ./scripts/generate-e2e-status-list.mjs" --> <!-- start generated list --> <!-- end generated list -->

Contributing

Consult the Contributing Guide.

Building your own bundle

Clone this repository, then run the following commands:

yarn build:cli

How it works

After building the CLI your global yarn will immediately start to reflect your local changes. This is because Yarn will pick up the yarnPath settings in this repository's .yarnrc.yml, which is configured to use the newly built CLI if available.

Works out of the box!

Note that no other command is needed! Given that our dependencies are checked-in within the repository (within the .yarn/cache directory), you don't even need to run yarn install. Everything just works right after cloning the project and is guaranteed to continue to work ten years from now 🙂

Yarn plugins

Default plugins

Those plugins typically come bundled with Yarn. You don't need to do anything special to use them.

Third-party plugins

Plugins can be developed by third-party entities. To use them within your applications, just specify the full plugin URL when calling yarn plugin import. Note that plugins aren't fetched from the npm registry at this time - they must be distributed as a single JavaScript file.

Creating a new plugin

To create your own plugin, please refer to the documentation.

Generic packages

The following packages are generic and can be used for a variety of purposes (including to implement other package managers, but not only):

Yarn packages

The following packages are meant to be used by Yarn itself, and probably won't be useful to other applications: