node-postgres is a PostgreSQL client for Node.js that provides non-blocking database access through pure JavaScript or optional native libpq bindings.
The tool solves the problem of connecting Node.js applications to PostgreSQL databases by offering a non-blocking client that works across multiple JavaScript runtimes including Node.js, Bun, Deno, and Cloudflare Workers. It implements the PostgreSQL wire protocol in pure JavaScript while also supporting native libpq bindings, allowing developers to choose between portability and performance. The client handles parameterized queries, connection pooling, named statements with query plan caching, async notifications via LISTEN/NOTIFY, and bulk operations through COPY TO/COPY FROM.
Developers should choose this tool if they need a lightweight PostgreSQL client without heavy abstraction layers. It suits projects ranging from simple scripts to production applications requiring connection pooling and advanced PostgreSQL features. The monorepo structure provides modular packages for specific needs: the core pg module for basic connectivity, pg-pool for connection management, pg-native for native bindings, pg-cursor and pg-query-stream for streaming results, and pg-protocol for low-level protocol handling.
The project maintains active development with regular updates to address bugs and improve documentation. The maintainer actively engages with the community through issue tracking and social channels, soliciting feedback on documentation clarity. The tool has established itself as a foundational library in the Node.js PostgreSQL ecosystem, with community contributions documented through a sponsors list.