Socket
Book a DemoInstallSign in
Socket

@yarnpkg/plugin-catalog

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yarnpkg/plugin-catalog

Source
npmnpm
Version
1.0.1
Version published
Maintainers
5
Created
Source

@yarnpkg/plugin-catalog

This plugin adds support for centralized dependency version management through catalogs, similar to pnpm's catalog feature.

It hooks into:

  • reduceDependency and replaces catalog ranges with the ones defined in a catalog.
  • beforeWorkspacePacking replacing catalogs with actual ranges before packing

Install

This plugin is included by default starting from Yarn 4.10.0.

Usage

Default Catalog

Define a catalog in your .yarnrc.yml:

catalog:
  react: ^18.0.0
  lodash: ^4.17.21

Then reference catalog entries in your package.json:

{
  "dependencies": {
    "react": "catalog:",
    "lodash": "catalog:"
  }
}

Named Catalogs

You can define multiple named catalogs for different purposes:

# Default catalog
catalog:
  lodash: ^4.17.21
  typescript: ~4.9.0

# Named catalogs
catalogs:
  react18:
    react: ^18.3.1
    react-dom: ^18.3.1

  react17:
    react: ^17.0.2
    react-dom: ^17.0.2

  vue3:
    vue: ^3.4.0
    vuex: ^4.1.0

Then reference them in your package.json:

{
  "dependencies": {
    "lodash": "catalog:",
    "react": "catalog:react18",
    "vue": "catalog:vue3"
  }
}

The comprehensive feature documentation can be found in packages/docusaurus/docs/features/catalog.mdx.

FAQs

Package last updated on 23 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts