node-postgres is a pure JavaScript PostgreSQL client for Node.js. Current version 0.6.2 is an early release with basic client, pool, SSL, and transaction support. It is unopinionated and low-level, requiring manual BEGIN/COMMIT/ROLLBACK for transactions. Unlike `pg` (the popular PostgreSQL client), this package has few features and is likely experimental or a simple wrapper.
npm install node-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connect to PostgreSQL, run a query, and close the connection using Client.
Use try/finally: const client = await pool.connect(); try { /* queries */ } finally { client.release(); }Checkout a client from pool, execute BEGIN/COMMIT/ROLLBACK manually, then release.
Pass ssl: { key: fs.readFileSync('path').toString(), cert: fs.readFileSync('path').toString() }.Set host: '127.0.0.1' and port: 5432 explicitly in Client/Pool config.
Ensure queries are made before calling end(). Use a single client per transaction.
Use const { Pool } = require('node-postgres');No dependency data recorded yet.