alternate npm and bower client focused on determinism, security and performance.
Yarn is a package manager for the npm and bower registries with a few specific focuses.
Determinism: Based around a version lockfile which ensures that operations on the
dependency graph can be easily transitioned. We check module directories and verify their
integrity to ensure yarn install
always produces the same file structure.
Security: Strict guarantees are placed around package installation. You have control over whether lifecycle scripts are executed for packages and package hashes are stored in the lockfile to ensure you get the same package each time.
Performance: We're always performing operations such as package resolving and fetching in parallel. This ensures little idle time and maximum resource utilization.
- Compatible with npm and bower. Supports mixing registries.
- Offline mode which resolves registry queries against local cache.
- Pretty, readable and minimal CLI output.
- Ability to rename packages and have multiple root level packages of the same name but different versions.
- Efficient and reliable package cache.
- Deterministic package installation.
- Stable public JS API with logging abstracted for consumption via build tools.
- Mutex to ensure multiple running CLI instances don't collide and pollute each other.
- Ability to restrict licenses of installed modules and ways to output licensing information.*
- Concise lockfile format. No whitespace, ordered keys to ensure minimal changes and noise.
- Vendored tarball dependencies.
- Ability to manually resolve version conflicts so only a single version per package exists. (Bower style)
- Efficient resolution, fetching and storage of git repos. We use hosted git APIs when using GitHub and Bitbucket for performance.
- Caching of build artifacts produced by install scripts.
- More emojis. 🐈
git clone [email protected]:yarnpkg/yarn.git yarn
cd yarn
npm install
npm run build
npm link
# go into some random directory
mkdir node_modules
yarn add your-package
Yarn wouldn't exist if it wasn't for excellent prior art. Yarn has been inspired by the following projects: