npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pncat

v0.8.0

Published

A unified cli tool that enhances package managers catalogs feature.

Readme

npm version npm downloads JSDocs License

pnpm add -D pncat

pnpm · yarn · bun · vlt

  • 🚀 Init - Initialize configuration with optimized rules
  • 🔍 Detect - Scan workspace to identify catalogable dependencies
  • 📦 Migrate - Automatically group dependencies by rules
  • ➕ Add - Install dependencies with catalog and workspace support
  • ➖ Remove - Safely remove dependencies and worksspace catalogs
  • 🧹 Clean - Find and remove unused catalog entries
  • ↩️ Revert - Revert cataloged dependencies to package.json

Usage

Init

pncat init
pncat create
pncat setup
pncat config
pncat conf

Initialize your workspace with an optimized configuration file. Analyzes your current workspace dependencies and generates tailored rules for better project visibility.

Detect

pncat detect
pncat d
pncat scan
pncat check
pncat find

Scans your workspace to identify dependencies that could be moved to catalogs.

Migrate

pncat migrate
pncat mig
pncat move
pncat mv
pncat m

[!NOTE] To update catalog groups according to rules, run pncat migrate -f, or do a clean migration with pncat revertpncat migrate.

Automatically groups dependencies by rules (e.g., lint, test, utils), updating both workspace catalog configuration and relevant package.json.

Default rules can be found in src/rules.ts. To customize rules, create a pncat.config.ts file in the root directory.

Add

pncat add dep
pncat install dep
pncat in dep
pncat i dep

Add dependencies with prompts and catalogs support (credit to @antfu/nip). It also supports adding monorepo workspace packages using the workspace: protocol.

You can specify a catalog name using --catalog name. When no catalog is specified, dependencies are automatically assigned based on your catalog rules configuration.

Remove

pncat remove dep
pncat rm dep
pncat r dep
pncat uninstall dep
pncat un dep
pncat u dep

Display which catalog group is using the dependency. If confirmed, it will remove the dependency from both workspace catalog configuration and package.json.

To remove a dependency from all packages in the monorepo, you can use pnpm remove dep -r or pnpm remove dep --recursive to recursively remove the dependency from all workspace packages.

Clean

pncat clean
pncat cl
pncat c
pncat prune

Find unused catalog dependencies and remove them from workspace catalog configuration.

Revert

pncat revert
pncat rev
pncat restore
pncat undo

Reverts cataloged dependencies to package.json. Useful for monorepo restructuring or migration.

You can also revert specific dependencies using:

pncat revert dep
pncat rev dep
pncat restore dep
pncat undo dep

Fix

pncat fix
pncat f

Automatically detects and fixes invalid catalog specifiers in workspace file by re-resolving and rewriting them to valid versions.

Configuration

You can use pncat init to initialize a configuration file with optimized rules based on your current workspace, or create a pncat.config.ts file manually to customize catalog rules:

import { defineConfig, mergeCatalogRules } from 'pncat'

export default defineConfig({
  // To extend default rules instead, use: catalogRules: mergeCatalogRules([...])
  catalogRules: [
    {
      name: 'vue',
      match: ['vue', 'vue-router', 'pinia'],
      // smaller numbers represent higher priority
      priority: 15,
      // Advanced: version-specific rules
      specifierRules: [
        { specifier: '<3.0.0', suffix: 'legacy', match: ['vue'] }
      ]
    }
  ],
  // Control how version ranges are processed
  specifierOptions: {
    skipComplexRanges: true,
    allowPreReleases: true,
    allowWildcards: false
  },
  // Saved dependencies will be configured with an exact version rather than using semver range operator
  saveExact: true,
  // Hook to run after command completion (supports string commands, functions, or arrays)
  postRun: 'eslint --fix "**/package.json" "**/pnpm-workspace.yaml"'
})

Catalog Rules:

  • name: catalog name (required)
  • match: packages to include, supports RegExp (required)
  • priority: smaller numbers represent higher priority (optional)
  • specifierRules: version-specific rules (optional)
    • specifier: semver range like ">=3.0.0", "<2.0.0" (required)
    • match: specific packages this rule applies to (optional, defaults to parent match)
    • name: complete catalog name (takes priority over suffix)
    • suffix: catalog suffix (e.g., "legacy", "modern")

Specifier Options (optional):

  • skipComplexRanges: Skip complex ranges like "||", "-", ">=" (default: true)
  • skipRangeTypes: Specific range types to skip (overrides skipComplexRanges)
    • '||': Logical OR (e.g., "^3.0.0 || ^4.0.0")
    • '-': Hyphen range (e.g., "1.2.3 - 2.3.4")
    • '>=', '<=', '>', '<': Comparison ranges
    • 'x': Wildcard (e.g., "3.x")
    • '*': Any version
    • 'pre-release': Beta/alpha/rc versions
  • allowPreReleases: Allow beta/alpha/rc versions (default: true)
  • allowWildcards: Allow wildcard versions like "3.x", "*" (default: false)

Why pncat?

For monorepo repositories, maintaining consistent dependency versions across multiple packages is crucial. Grouping dependencies can significantly improve project understanding, making it easier to collaborate within teams or keep track of the project's structure.

Currently, pnpm's catalog support is limited. For example, there is no built-in feature for adding or migrating dependencies into specific groups. Managing the catalog manually across the entire project can be time-consuming and error-prone. To address this, pncat was developed.

Additionally, when migrating a specific package in a monorepo that uses catalogs, it's important to also migrate the workspace catalog configuration. This requires manually comparing which catalogs need to be removed. To streamline this process, the clean and revert commands were introduced to automate this task.

Inspiration

This project is inspired by and builds upon the excellent work of the following projects:

  • taze - provided essential monorepo I/O utilities for reading and parsing workspace configuration and package.json files across workspace packages
  • @antfu/nip - inspired the interactive prompts and user experience design for dependency management workflows

Special thanks to @antfu for his article Categorizing Dependencies which provided great inspiration and guidance during the development of this tool.

Related Projects

Contributors

Contributors

License

MIT License © jinghaihan