Almost a year ago we launched Yarn. The main focus is stability, resiliency, and performance, said, Facebook engineers. They claim that large companies like Twitter and Microsoft used the software and reduced package install times by a factor of five.
In addition to speed, Yarn’s main reason is to make the installations more reliable and reproducible through the inclusion of lock files. These files limit installed dependences to a specific version, to make every install result in the same file structure in the node_modules folder across all machines.
Yarn’s deterministic approach to package management has appealed to devops automation, where scripts demand consistent behavior. Yarn 1.0 adds some new bells and whistles. A feature called Workspaces designed to make life easier for companies that prefer a single large code repository, to avoid dependency synchronization problems, over distributed repositories.
Workspaces allow users to gather dependences listed in multiple package.json files and install them in subfolders of a single root package.json file, under a single lock file. A new auto-merge mechanism resolves lock file merge conflicts that may arise after the yarn install command.
Also, a selective version resolution features designed to handle situations where layers of dependencies delay the availability of patched code. Instead of waiting for a direct dependency to update or forking code for a fix, the resolution field in package.json files can demand specific versions of sub-dependencies.
Facebook team says, we hope to make Yarn more useful for providing some assurance that packages are safe. Also, planning to work with npm to add two-factor authentication to Yarn to enhance package security.