Suggest an editImprove this articleRefine the answer for “What are pnpm workspaces?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**pnpm workspaces** are a mechanism that lets you combine several related projects (packages) into one shared repository (a monorepo) and manage their dependencies centrally. This is convenient when a single repo holds several packages, libraries, or services that share dependencies or depend on each other. **Key point:** through workspaces, one package can depend on another package in the same repository without publishing it to npm, pnpm creates the local link automatically.Shown above the full answer for quick recall.Answer (EN)Image**pnpm workspaces** are a mechanism that lets you combine several related projects (packages) into one shared repository (a monorepo) and manage their dependencies centrally. This is convenient when a single repo holds several packages, libraries, or services that share dependencies or depend on each other. --- ### **Problems workspaces solve** 1. **Unified dependency management** Shared packages are installed once, not in every project. 2. **Linking packages locally to each other** A package can depend on another package in the same repository without publishing it to npm, pnpm creates the local link automatically. 3. **Optimized installation** Installing all dependencies for all packages happens with one command, fast and without duplication. 4. **Convenience for large projects and monorepos** Suits frontend, backend, libraries, and CLIs inside a single repo. --- ### **Example workspace structure** ```javascript my-monorepo/ pnpm-workspace.yaml packages/ app/ package.json ui/ package.json ``` The `pnpm-workspace.yaml` file: ```yaml packages: - "packages/*" ``` --- ### **How it is used** | Action | Command | |---|---| | Install dependencies for all packages | `pnpm install` | | Run a script in one package | `pnpm --filter app dev` | | Add a dependency to a specific package | `pnpm add react --filter app` | --- ### **Summary** **pnpm workspaces** are a tool for working with monorepos that lets you efficiently manage several packages in one repo, share dependencies, speed up installation, and easily link local packages together.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.