pg-helper is a minimal, low-level helper library for PostgreSQL in Node.js, providing simple query building and execution on top of the pg driver. Current stable version is 0.0.8; the project is in early development with infrequent releases. It offers basic CRUD operations and connection pool wrappers but is explicitly marked as experimental and potentially insecure (e.g., raw string interpolation for dynamic values). Compared to mature alternatives like knex, pg-promise, or slonik, it lacks validation, escape helpers, migration support, and advanced features. Suitable only for prototyping or trivial scripts where security is not a concern.
npm install pg-helperNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to initialize a database connection using createDb, execute raw queries, and retrieve results.
Switch to a production-ready library like knex, pg-promise, or slonik.
Use dynamic import() or switch to ESM project.
Always use parameterized queries with $1 etc. if supported, or migrate to a library with proper escaping.
Create a .d.ts file or use a type-safe alternative.
Run `npm install pg-helper` and use ESM import syntax.
Use `import { createDb } from 'pg-helper'` instead of `const { createDb } = require('pg-helper')`.