Utility library to parse PostgreSQL connection credentials from environment variables (POSTGRES_HOST, POSTGRES_PASS, etc.) into a configuration object or connection URI string. Current stable version is 1.1.0, released as a minimal zero-dependency TypeScript package. Unlike manual parsing, it handles multiple env var naming conventions, supports optional fallback defaults, and returns a typed object compatible with libraries like 'pg' or 'node-postgres'. Ships with TypeScript declarations and is ESM/CJS compatible.
npm install pg-connection-from-envNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows default and custom env usage to get a connection config object.
Do not set POSTGRES_SSL to 'false'; leave it unset or set to empty string to disable SSL.
Use only URI env var or only individual vars, not both. Or use fallback defaults with explicit override options.
Ensure POSTGRES_PORT is a valid numeric string or leave it unset.
Use named import: import { getPgConnectionFromEnv } from 'pg-connection-from-env'Run: npm install pg-connection-from-env
Update to version 1.0.0 or later: npm install pg-connection-from-env@latest
No dependency data recorded yet.