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 🙏

© 2025 – Pkg Stats / Ryan Hefner

migration-cleaner

v1.0.0

Published

Automatically clean migration-generated file changes while preserving your own changes

Readme

migration-cleaner

Automatically clean migration-generated file changes while preserving your own changes. Zero configuration required!

Installation

npm install --save-dev migration-cleaner
# or
yarn add -D migration-cleaner

That's it! The package will automatically:

  • ✅ Install pre-commit hook
  • ✅ Create .git-exclude-list.example template
  • ✅ Set up everything you need

Quick Start

  1. Copy the exclude list template:

    cp .git-exclude-list.example .git-exclude-list
  2. Edit .git-exclude-list and add files you want to exclude (one per line):

    package.json
    babel.config.json
    .gitlab-ci.yml
  3. After running migration, save snapshot:

    git-migration-save
    # or
    migration-cleaner save
  4. Commit normally - changes will be auto-cleaned! 🎉

Commands

git-migration-save or migration-cleaner save

Save snapshot of migration files. Run this immediately after running your migration tool.

git-migration-clean or migration-cleaner clean

Manually clean migration changes while preserving your changes.

git-migration-status or migration-cleaner status

Show which files have user changes vs migration-only changes.

How It Works

  1. After migration: Run git-migration-save to snapshot migration-generated files
  2. Make your changes: Edit files normally
  3. On commit: Pre-commit hook automatically:
    • Discards files that only have migration changes
    • Cleans migration changes from files that have your changes
    • Preserves your changes automatically

Example Workflow

# 1. Run your migration tool
momo-migration

# 2. Save snapshot
git-migration-save

# 3. Make your changes
vim package.json  # Add your dependencies

# 4. Commit - hook automatically handles cleanup!
git add .
git commit -m "Add my feature"
# ✅ Only your changes are committed!

Configuration

.git-exclude-list

List of files to exclude from commits (one per line). Comments start with #.

Example:

# Migration-generated files
package.json
babel.config.json
.gitlab-ci.yml

# Build artifacts
sourcemap/
coverage/

.git-exclude-list.local

Personal exclude list (not tracked in git). Same format as .git-exclude-list.

Features

  • 🚀 Zero configuration - Works out of the box
  • 🧹 Automatic cleanup - Pre-commit hook handles everything
  • 💾 Smart detection - Only cleans migration changes, preserves yours
  • 🔄 Works with any migration tool - Not tied to specific tools
  • 📦 Lightweight - No heavy dependencies

Troubleshooting

Hook not running?

# Make sure hook is executable
chmod +x .git/hooks/pre-commit

# Test hook manually
.git/hooks/pre-commit

Need to commit excluded file anyway?

# Temporarily remove from exclude list, commit, then add back
# Or use --no-verify to skip hooks (not recommended)
git commit --no-verify

See what files are staged?

git status
git diff --cached --name-only

License

MIT