pnpm

Manage Node.js project dependencies with pnpm workspace features.

490|23|Updated Sep 25, 2023
One-click install
npx skills add https://github.com/victorgarciaesgi/regle --skill pnpm-victorgarciaesgi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pnpm
Source: https://github.com/victorgarciaesgi/regle/tree/main/.agents/skills/pnpm
Command: npx skills add https://github.com/victorgarciaesgi/regle --skill pnpm-victorgarciaesgi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

pnpm is a fast, disk space efficient package manager for Node.js that helps teams avoid bloated node_modules and manage large codebases with multiple packages.

Core Features & Use Cases

  • Monorepo support: Simplified workspace management with pnpm-workspace.yaml and catalogs.
  • Deterministic installs: Strict dependency resolution to prevent phantom dependencies.
  • Store efficiency: Central content-addressable store with hard links to minimize disk usage.
  • Use Case: Large organizations maintaining several packages can coordinate versions and builds across teams.

Quick Start

Install Node.js and pnpm, initialize a workspace with pnpm-workspace.yaml, then run pnpm install at the repo root to bootstrap dependencies and explore workspace commands like pnpm -r run build.

Frequently Asked Questions about pnpm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage dependencies in a Node.js monorepo without bloating node_modules?

pnpm manages dependencies in a Node.js monorepo using a central content-addressable store with hard links, minimizing disk usage. It simplifies workspace management via pnpm-workspace.yaml to coordinate versions across multiple packages efficiently.

What is strict dependency resolution and how does it prevent phantom dependencies?

Strict dependency resolution ensures packages only access dependencies explicitly declared in their manifest. This prevents phantom dependencies, ensuring deterministic installs where packages cannot accidentally import modules they never specified.

How do I set up a pnpm workspace for a large multi-package codebase?

To set up a pnpm workspace, initialize a pnpm-workspace.yaml file at your repository root to define package locations, then run pnpm install to bootstrap dependencies and use commands like pnpm -r run build for coordinated builds.

Do I need Node.js and .npmrc installed to use pnpm workspaces?

Yes, using pnpm workspaces requires Node.js and pnpm installed locally. Standard configuration files like .npmrc and a pnpm-workspace.yaml file are also needed for accurate context loading and workspace setup.

How do catalogs and patches work when coordinating package versions across teams?

Catalogs and patches in pnpm allow large organizations to coordinate dependency versions and apply modifications across multiple packages. This ensures consistent builds and version management across different teams sharing a monorepo.