Сравнение возможностей
Возможность | pnpm | Yarn | npm | Notes |
---|---|---|---|---|
Поддержка воркспейсов | ✅ | ✅ | ✅ | |
Изолированная node_modules | ✅ | ✅ | ✅ | Default in pnpm. |
Не иерархичность node_modules | ✅ | ✅ | ✅ | Default in npm. |
Plug'n'Play | ✅ | ✅ | ❌ | Default in Yarn. |
Авто-установка peerDependencies | ✅ | ❌ | ✅ | |
Zero-Installs | ❌ | ✅ | ❌ | |
Патчинг зависимостей | ✅ | ✅ | ❌ | |
Управление версиями Node.js | ✅ | ❌ | ❌ | |
Managing versions of itself | ✅ | ✅ | ❌ | |
Имеет lock-файл | ✅ | ✅ | ✅ | pnpm-lock.yaml , yarn.lock , package-lock.json . |
Поддержка переопределений | ✅ | ✅ | ✅ | Known as "resolutions" in Yarn. |
Контенто-адресуемое хранилище | ✅ | ✅ | ❌ | Yarn uses a CAS when nodeLinker is set to pnpm . |
Динамическое выполнение пакетов | ✅ | ✅ | ✅ | pnpm dlx , yarn dlx , npx . |
Side-effects cache | ✅ | ❌ | ❌ | |
Catalogs | ✅ | ❌ | ❌ | |
Config dependencies | ✅ | ❌ | ❌ | |
JSR registry support | ✅ | ✅ | ❌ | |
Auto-install before script run | ✅ | ❌ | ❌ | In Yarn, Plug'n'Play ensures dependencies are always up to date. |
Хуки | ✅ | ✅ | ❌ | |
Listing licenses | ✅ | ✅ | ❌ | pnpm supports it via pnpm licenses list . Yarn has a plugin for it. |
Note: To keep the comparison concise, we include only features likely to be used frequently.