postgres-queryparser

JSON →
library 1.1.7 ·javascript
verified Jun 5, 2026

A lightweight Node.js utility for substituting PostgreSQL parameterized queries with actual values. It provides two methods: parseQuery (basic substitution) and generateQuery (with error validation). Version 1.1.7 is the latest stable release with low release cadence. Key differentiators: simple CJS-only package, handles arrays, nulls, and escape characters in values. Works with any PostgreSQL library (e.g., node-postgres) to generate final SQL strings for debugging or logging. Not an AST parser or SQL formatter; purely a string replacement tool for $N placeholders.