Convert PostgreSQL's keyword/value connection strings to URI connection strings.
npm install \
--ignore-scripts \
--save \
'github:c032/node-postgresql-keyword-value-to-uri#js'
import { keywordValueToUri } from "postgresql-keyword-value-to-uri";
const connectionString = keywordValueToUri(
`host=postgresql user=user_name password='correct horse battery staple' dbname=database_name sslmode=disable`
);
// `connectionString` is "postgresql://user_name:correct%20horse%20battery%20staple@postgresql/database_name?sslmode=disable".
Why not send PR to pg-connection-string?
See brianc/node-postgres#2125.
MPL 2.0.