Yarn (Package Manager)
A fast, reliable, and secure dependency management tool for JavaScript applications.
Yarn (Yet Another Resource Negotiator) was created to address perceived shortcomings in the npm client, such as performance and determinism. It caches every package it downloads so it never needs to download the same package again. It also uses checksums to verify the integrity of every installed package before its code is executed. Yarn uses a lockfile (yarn.lock) to ensure that the exact same dependencies are installed on every machine, preventing 'works on my machine' issues.
graph LR
Center["Yarn (Package Manager)"]:::main
Rel_npm["npm"]:::related -.-> Center
click Rel_npm "/terms/npm"
Rel_javascript["javascript"]:::related -.-> Center
click Rel_javascript "/terms/javascript"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Explain Like I'm 5
Generated ELI5 content
🤓 Expert Deep Dive
Generated expert content
❓ Frequently Asked Questions
What is the difference between Yarn and npm?
Both manage dependencies, but Yarn historically focused on speed and deterministic installs, though npm has caught up.
What is yarn.lock?
A file that locks the versions of installed dependencies to ensure consistency across environments.
Who developed Yarn?
It was developed by Facebook (Meta) in collaboration with Exponent, Google, and Tilde.