Yarn was released by Facebook (now Meta) in October 2016, created by Sebastian McKenzie, Christoph Nakazawa, and other engineers. It was born out of frustration with npm’s speed and reliability issues at the time, particularly around inconsistent installs across different machines.
Yarn Classic (v1) introduced several features that were later adopted by npm itself: lock files for deterministic installs, parallel package downloads, and offline caching. It was significantly faster than npm v3 and quickly gained adoption across the JavaScript community.
Yarn Berry (v2+), released in 2020, was a complete rewrite that introduced Plug’n’Play (PnP). Instead of the traditional node_modules folder with thousands of files, PnP uses a single .pnp.cjs file that maps package imports to zip archives. This eliminates node_modules entirely, speeds up installs dramatically, and reduces disk usage by up to 70%.
Yarn supports workspaces natively, making it popular for monorepo setups. Companies like Facebook, Google, and Stripe use Yarn to manage large codebases with dozens of interconnected packages. The constraints feature lets teams enforce rules across their monorepo, like ensuring all packages use the same version of React.
With over 41,000 GitHub stars, Yarn remains a major player in the JavaScript tooling space. While npm has caught up on many features, Yarn’s PnP approach and workspace capabilities keep it relevant for teams that need advanced package management.