Yarn is an open-source JavaScript package manager and project manager. Originally created at Facebook in 2016, Yarn is now a fully independent community-governed project. The current generation — Yarn Berry, currently v4 — lives at yarnpkg/berry and is written in TypeScript under the BSD-2-Clause license.
Yarn was the first package manager designed specifically around workspaces and introduced Plug'n'Play (a node_modules-free module resolution strategy), Zero-Installs (committable caches for instant clones), Constraints (a cross-workspace policy DSL), a rich protocol system, and a first-class plugin API.
This repository is the API Evangelist catalog entry for Yarn. It captures the Yarn surface area in apis.yml along with supporting artifacts.
- Yarn CLI —
yarn install,add,remove,up,run,exec,dlx,info,why,pack,rebuild,dedupe,node,bin,search,upgrade-interactive,stage - Yarn Workspaces —
yarn workspace,yarn workspaces foreach,yarn workspaces focus,yarn workspaces list - Yarn Plug'n'Play (PnP) — node_modules-free dependency resolution via a single
.pnp.cjsmanifest, plus a Rust implementation (pnp-rs) - Yarn Zero-Installs — commit the cache so clones bootstrap with no
yarn install - Yarn Constraints — JavaScript and Prolog DSL for cross-workspace policy enforcement
- Yarn Protocols —
npm:,git:,github:,file:,link:,portal:,patch:,exec:,workspace:, andhttp(s): - Yarn Plugin API — register commands, resolvers, fetchers, linkers, and lifecycle hooks via
@yarnpkg/core - Yarn Version (Release Workflow) — deferred per-workspace version decisions applied at release time
- Yarn Patch —
yarn patch/yarn patch-commitfor first-class dependency patching - Yarn DLX — ephemeral package execution (Yarn's npx replacement)
- License: BSD-2-Clause
- Governance: independent community project, GOVERNANCE.md in
yarnpkg/berry - Language: TypeScript (~85%), with Rust for
pnp-rs - Distribution: Corepack (recommended), or
npm install -g yarn - Pin to project: the
packageManagerfield inpackage.json, oryarn set version stable - Configuration:
.yarnrc.yml - Manifest:
package.json - Lockfile:
yarn.lock(text-based, deterministic)
| Package | Purpose |
|---|---|
@yarnpkg/core |
Programmatic API used by the CLI and plugins |
@yarnpkg/cli |
Command-line interface built on @yarnpkg/core |
@yarnpkg/pnp |
Plug'n'Play hook generation |
@yarnpkg/fslib |
Type-safe filesystem abstraction |
@yarnpkg/shell |
Portable bash-like shell interpreter for package.json scripts |
@yarnpkg/sdks |
Editor SDKs (VS Code, Vim, etc.) for PnP integration |
plugin-npm— npm registry resolutionplugin-pnp— Plug'n'Play installationplugin-workspace-tools— monorepo coordinationplugin-npm-cli—yarn npm publish/ login / audit / tag / whoamiplugin-constraints—yarn constraintsenforcementplugin-typescript— automatic@types/*co-installationplugin-interactive-tools—yarn upgrade-interactive,yarn searchplugin-stage— stage Yarn files to version control
apis.yml— APIs.json v0.16 catalog entryvocabulary/yarn-pkg-vocabulary.yml— Yarn vocabularyjson-ld/yarn-pkg-context.jsonld— JSON-LD context for Yarn conceptsjson-schema/yarn-pkg-workspace-schema.json— JSON Schema for a Yarn workspacepackage.json
- Homepage: https://yarnpkg.com
- Getting started: https://yarnpkg.com/getting-started
- Install: https://yarnpkg.com/getting-started/install
- CLI reference: https://yarnpkg.com/cli
- Programmatic API: https://yarnpkg.com/api
- Migration guide: https://yarnpkg.com/migration/guide
- GitHub: https://github.com/yarnpkg/berry
- RFCs: https://github.com/yarnpkg/rfcs
- Discord: https://discord.gg/yarnpkg
- Open Collective: https://opencollective.com/yarnpkg
This catalog entry's content is published under the API Evangelist editorial license. Yarn itself is licensed under BSD-2-Clause.