Yarn is a package manager that serves as a JavaScript NODE.js runtime environment. It was created in 2016 through a collaboration between Facebook, Google and Expo.dev, and is widely considered to be the most important competitor to the well-known NPM package manager. It doesn't have its own repository package, but it can download packages from other repositories including the one mentioned above.

Laptop, Yarn

Yarn - a modern alternative to the NPM package manager

The main advantage of Yarn is its remarkable speed, because during installation it first checks the global cache directory and looks for packages that have been previously downloaded in them, and when it finds such, it automatically uses them. When it doesn't find a particular package, it downloads it and saves it in the global cache, and then copies all the dependencies. NPM, on the other hand, always scans all dependencies first and only then downloads the necessary packages. What's more, Yarn performs all these actions simultaneously, and thanks to its use of a global cache, it allows you to work offline. It is also an extremely secure file manager, as it uses checksum checking, so developers can be sure that no data will be lost when downloading subsequent packages. As a result, developers have identical versions of packages, which makes teamwork much easier. In addition, Yarn is open source software and is constantly being developed, so new updates are frequently released, and its documentation is constantly being improved based on user experience.

Related articles

Show all articles