bun-pg-listen

JSON →
library 0.1.1 ·javascript
verified Jun 5, 2026

Zero-dependency polyfill for PostgreSQL LISTEN/NOTIFY in Bun, currently at v0.1.1 with active development. Since Bun's built-in sql driver does not implement LISTEN/NOTIFY, this library provides a temporary, drop-in replacement that mirrors Bun.sql's connection configuration (env vars, URL, inline options) and adds SCRAM-SHA-256 authentication (RFC 7677), exponential backoff reconnection with automatic re-LISTEN, and TLS support (sslmode=require/verify-ca/verify-full). Designed to be removed once Bun native support lands (tracking issue oven-sh/bun#18214). Unlike alternatives like pg or postgres.js, it has zero runtime dependencies and focuses solely on the listen/notify pub/sub pattern for Bun >= 1.2 and Postgres >= 13.