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

@fork-hu/db-cleaner

v1.0.1

Published

Remove INSERT INTO statements for specified tables from MySQL dump files

Readme

fork-db-cleaner

A lightweight Node.js CLI that processes MySQL dump files and removes INSERT INTO statements for specified tables (e.g. ntakmessages). Uses streaming to handle large dumps without loading the entire file into memory.

Requirements

  • Node.js 18+

Install

npm install -g @fork-hu/db-cleaner

Or run via npx without installing:

npx @fork-hu/db-cleaner -i dump.sql -o cleaned.sql

Usage

db-cleaner --input <path> --output <path> [--tables table1,table2,...] [--before YYYY-MM-DD] [--created-at-column createdAt]

Alias: fdclean (shorthand)

| Option | Short | Required | Default | Description | |-----------------------|-------|----------|-----------------|--------------------------------------------------------------------------| | --input | -i | Yes | — | Path to the source MySQL dump file | | --output | -o | Yes | — | Path to write the cleaned SQL file | | --tables | -t | No | ntakmessages | Comma-separated table names to process | | --before | -b | No | — | Cutoff date: keep only rows where createdAt ≥ this date (YYYY-MM-DD) | | --created-at-column | — | No | createdAt | Column name used for date filtering (when --before is set) |

Examples

Remove only ntakmessages inserts (default):

db-cleaner -i dump.sql -o cleaned.sql

Remove inserts for multiple tables:

db-cleaner -i dump.sql -o cleaned.sql -t ntakmessages,audit_log,sessions

PowerShell users: Quote arguments containing commas, or use multiple -t flags:

db-cleaner -i dump.sql -o cleaned.sql -t "ntakmessages,orderitems" -b 2025-01-01
db-cleaner -i dump.sql -o cleaned.sql -t ntakmessages -t orderitems -b 2025-01-01

Keep only recent records (filter by createdAt):

db-cleaner -i dump.sql -o cleaned.sql -b 2025-01-01

Output

The tool prints a summary when done:

Done. 1,204,300 lines processed, 98,440 lines removed. Output: cleaned.sql

With --before, it also reports rows kept vs removed:

Done. 196,701 lines processed, 7,715 lines removed. Rows kept: 9,003, rows removed: 7,179. Output: dump-filtered.sql

The output file is a valid MySQL dump and can be imported with:

mysql -u user -p database < cleaned.sql