On this page
Overview
node-postgres is a collection of PostgreSQL clients for Node.js. Its main pg package provides a pure JavaScript client and optional native libpq bindings behind the same API, with connection pooling, parameterized queries, prepared statements, LISTEN/NOTIFY, and COPY support.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Build PostgreSQL access around pools and parameterized queries
pg and pg-pool provide pooled connections and parameterized queries so values can be sent separately from SQL text instead of being concatenated into statements.
Use prepared statements, LISTEN/NOTIFY, COPY, and PostgreSQL type handling
The client supports named statements with plan caching, asynchronous notifications, COPY import/export, and extensible JavaScript/PostgreSQL type coercion.
Sources: [1]
Best fit
Fits Next.js Node runtimes and backend services that want direct PostgreSQL control
It is useful when teams want SQL and connection-pool control closer to PostgreSQL rather than through a higher-level ORM. The monorepo also includes runtime-related packages for other JavaScript environments.
Before adoption
Design pool lifecycle and connection limits explicitly for serverless deployments
Creating a new pool per request can exhaust database connections. Next.js and serverless deployments should define module-level reuse, provider-side pooling, and transaction requirements deliberately.
Sources: [1]
The current pg 8.23.1 package requires Node 16 or newer
The current master package metadata reports pg 8.23.1 with a Node.js 16+ engine requirement. Check the target runtime and optional native-binding requirements before deployment.
Sources: [2]
Official sources
- [1]node-postgres README(2026-10-06)
- [2]pg 8.23.1 package metadata(2026-10-06)
- [3]node-postgres MIT license(2026-10-06)
Supplemental curator note
It fits Node.js backends that want lower-level PostgreSQL control than an ORM. In Next.js and serverless environments, design pool reuse and connection limits explicitly.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/brianc/node-postgres.git - 2
Enter the repository
cd node-postgres - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
13,218 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 10
- Open PRs
- 89
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- postgresql
- postgresql-driver
- node-postgres
- postgres
- libpq
- Stars
- 13,218
- Forks
- 1,357
- Watchers
- 179
- Open issues
- 451
- Contributors
- 335
- Owner type
- User
- Primary language
- JavaScript
- License
- MIT
- Repository last updated
- Oct 1, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- npm CLI10,171 Stars
3 shared tag(s) · 1 shared category(s) · Same language
Manage JavaScript project dependencies and published packages from the command line
JavaScript - i18next8,636 Stars
3 shared tag(s) · 1 shared category(s) · Same language
keep translation keys, plurals, interpolation, and resource loading independent of the UI framework
JavaScript - fake-indexeddb695 Stars
3 shared tag(s) · 1 shared category(s) · Same language
recreate the IndexedDB API in memory for Node.js tests
JavaScript - Electron123,388 Stars
3 shared tag(s) · 1 shared category(s)
bundle Chromium and Node.js to build desktop applications for three major operating systems with HTML, CSS, and JavaScript
C++ - Playwright97,099 Stars
3 shared tag(s) · 1 shared category(s)
Drive Chromium, Firefox, and WebKit through one API and test runner for E2E, scripting, and agent browser automation
TypeScript - pnpm36,742 Stars
3 shared tag(s) · 1 shared category(s)
share dependency files through a content-addressable store and manage monorepos
Rust
Report incorrect information
Tell us if any listing information is incorrect or outdated.