
Last night, Facebook officially announced a new JavaScript package manager called Yarn. At one of the development stages, Google, Exponent and Tilde joined the project.
“The most popular JavaScript package manager is NPM. It provides access to more than 300 thousand packages. It is used by more than 5 million developers, and monthly it is accessed for download more than 5 billion times.
')
We have successfully used NPM on Facebook for many years, but as the amount of our code and the number of developers grew, we faced issues of consistency, security, and performance. After trying to solve all these issues, we decided to create our own solution to ensure the reliability of the development management. The result of this work was Yarn - a fast, reliable and safe alternative to the NPM client, ”the
official Facebook blog says about the new product.
Facebook developers claim that Yarn still allows you to access NPM packages, but at the same time allows you to quickly and consistently manage dependencies between machines, or work in a protected environment offline. This, according to the creators of Yarn, will allow developers to focus on what is really important - the creation of new products and functions. Here is a list of the main distinguishing features of Yarn:
- offline mode;
- determinism;
- network performance;
- the presence of several registries;
- network flexibility;
- the presence of Flat Mode;
- more emoji (and with cats too).
The social network had several reasons for creating its own alternative to NPM. Of course, the main one was performance, as well as installation speed and paralleling operations. Another Yarn allows you to achieve uniformity on different machines. In the case of NPM, depending on the connected modules, the node_modules directory could be very different from machine to machine. In the case of small development teams, such customization may be acceptable, but not in the case of a huge Facebook DevOps team.
The developers of the original NPM are a commercial organization that was aware of the creation and soon release of a competitor. However, the business model of the project is not built around the client, but around the catalog, which is also used by Yarn. Therefore, the novelty from Facebook and Google does not pose a big threat to them.
The Facebook team decided to move its development beyond the internal repository of the company and
put Yarn on GitHub , where you can get acquainted with the project and take part in the development.