qp-postgres is a lightweight PostgreSQL utility library for Node.js, version 1.1.8 as of latest release. It provides helper functions for common PostgreSQL operations, including connection pooling, query building, and transaction management. The package is designed to be minimal and dependency-free, relying only on the native pg library. It differentiates itself by focusing on a simple, functional API without heavy ORM features. Release cadence is irregular, with the last update likely inactive. Best for small projects needing straightforward PostgreSQL helpers.
npm install qp-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a pg Pool, run a simple query using qp.query, and log the result. Demonstrates ESM import and usage with environment variable for connection.
Install pg: npm install pg
Always pass the pool explicitly: qp.query(pool, text, params)
Wrap transaction logic in try-catch and call pool.query('ROLLBACK') on error.Install pg and ensure pool is provided to qp functions.
Use import * as qp from 'qp-postgres' or import { query } from 'qp-postgres'.