/berry

📦🐈 A modern, fast, reliable, package manager; part of the Yarn organization

Primary LanguageJavaScriptOtherNOASSERTION

Yarn

Fast, reliable, and secure dependency management.

Azure Pipelines status Discord Chat Stable Release Prerelease


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

  • Yarn supports plugins; adding a plugin is as simple as adding it into your repository
  • Yarn supports Node by default but isn't limited to it - plugins can add support for other languages
  • Yarn supports workspaces natively, and its CLI takes advantage of that
  • Yarn uses a portable shell to execute package scripts, guaranteeing they work the same way on Windows and Linux
  • Yarn is first and foremost a Node API that can be used programmatically (via berry-core)
  • Yarn is written in TypeScript, and fully typechecked

Install

Because this repository is about the modern but experimental version of Yarn (aka Yarn v2), the install process is slightly different for the time being.

  • Open one of your project
  • First run yarn policies set-version nightly - to be sure that the next command will work
  • Then run yarn policies set-version berry - this will fetch the v2 bundle
  • And voilà! Just run any command, such as yarn config -v - they will use the v2
  • To revert, just remove the local change to your .yarnrc file

Documentation

The documentation is being reworked to contain an updated content and a refreshed design, and the most up-to-date version can be found on the repository GitHub pages: yarnpkg.github.io/berry

Generic packages

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

Yarn plugins

The following packages are plugins for Berry and can be installed through berry add plugin <plugin-name>. Note that some of them are typically already shipped with the regular Yarn bundles. Such plugins are marked with a star (★).

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

Yarn packages

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

Build your own bundle

Clone this repository, then run the following commands:

$> yarn build:cli

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