A lightweight Node.js library for cleaning PostgreSQL databases during testing. Current version 1.0.6. Provides simple truncate or delete operations to clear all tables and reset sequences. Key differentiator: minimal API for test teardowns, supports skipping specific tables. Released as needed, maintenance mode.
npm install postgres-cleanerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to clean a PostgreSQL database using truncate with a skipped table.
Call pool.end() after cleaner completes if you want to release resources.
Create a Pool from pg-promise's pg module: const pool = pgp.pg.Pool({connectionString: ...})Ensure property name is exactly 'skipTables' as an array of strings.
Use type: 'truncate' (default) for reliable sequence reset.
Use const cleaner = require('postgres-cleaner');Ensure cleaner runs outside a transaction that might rollback.
Extract the underlying pg Pool: const pool = pgp.pg.Pool({...});No dependency data recorded yet.