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

pattypan

v1.0.2

Published

Squash Prisma migrations with intelligent redundancy detection

Readme

The squasher folds compatible ALTER TABLE operations into the originating CREATE TABLE so output is a compact schema baseline (instead of appending retained statements).

Requirements

  • Node.js 18.18+ or Bun
  • A Prisma project with a migrations directory such as prisma/migrations
  • If you plan to run the generated Prisma metadata sync helper: prisma and @prisma/client

Install

Run without installing:

npx pattypan

If you use Bun:

bunx pattypan

Install globally with npm:

npm install -g pattypan

Then run it as:

pattypan prisma/migrations

Usage

Primary workflow (boundary-based quick pick):

npx pattypan prisma/migrations

Or, if installed globally:

pattypan prisma/migrations

In quick mode, you:

  1. Pick one boundary migration from a newest-first list (page size 5).
  2. Tool auto-selects that migration plus all newer migrations.
  3. Tool opens a prechecked cherry-pick list where you can uncheck any items.

Non-interactive boundary workflow:

npx pattypan prisma/migrations --from 20240115094500_add_orders

You can also pass a unique fragment:

npx pattypan prisma/migrations --from add_orders

Optional additive exclusions (applied after boundary selection):

npx pattypan prisma/migrations --from add_orders --exclude production_20240101,production_20240115

Useful options:

  • --from <migration>: boundary migration name or unique fragment
  • --exclude <patterns>: comma-separated migration filters to skip
    • supports * wildcard, otherwise substring matching
  • --yes, -y: skip confirmation prompt
  • --remove-dml: strip INSERT, UPDATE, and DELETE statements from the squashed output
  • --name <migration_name>: set output migration directory name
  • --latest, -n <count>: legacy selection mode for latest N migrations
  • --allow-gaps: legacy latest mode only

If selected migrations contain data-migration statements (INSERT, UPDATE, or DELETE), Pattypan keeps them by default. Interactive runs offer a prompt to remove them, and non-interactive runs can opt in with --remove-dml.

Output

Each squash writes:

  • a new squashed migration.sql inside the selected output migration directory
  • a companion syncPrismaMigrations.ts file in the migrations directory root

The generated syncPrismaMigrations.ts helper is intended for existing databases where you need to replace the selected _prisma_migrations rows with the new squashed migration entry.

Development

If you are working on Pattypan itself:

bun install
bun run build
bun test

Interactive modes:

  • quick mode: pick boundary migration (recommended)
  • manual mode: checkbox migration selection