pg-connection-string
npmv2.14.0TypeScriptFunctions for dealing with a PostgreSQL connection string
Safe to adopt
Yes — pg-connection-string scores well across adoption, maintenance, weight, supply chain, and licensing. 38.9M downloads per week and 2 known dependents. Last published 83 days ago. 14 releases in the last 2 years.
- AAdoption: grade A, Excellent.
38.9M downloads per week and 2 known dependents.
- AMaintenance: grade A, Excellent.
Last published 83 days ago. 14 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 16 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 4 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding pg-connection-string to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- ESM + CommonJS
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the pg-connection-string README.
const parse = require('pg-connection-string').parse;
const config = parse('postgres://someuser:somepassword@somehost:381/somedatabase')pg-connection-string vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| pg-connection-stringthis page | 38.9M | 2 | MIT | 2 months ago |
| query-string | 22.1M | 3 | MIT | 1 day ago |
| parse-json | 0 | 2 | MIT | 1 day ago |
| strnum | 0 | 1 | MIT | 1 day ago |
| escape-string-regexp | 316.5M | 8 | MIT | 1 day ago |
| is-glob | 137.4M | 3 | MIT | 1 day ago |
Dependencies
Declared by pg-connection-string v2.14.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (8)
Used by
Popular packages that depend on pg-connection-string.
Relationship graph
Dependencies (left) and dependents (right) of pg-connection-string.
Frequently installed together
A socket implementation that can run on Cloudflare Workers using native TCP connections.
Next generation testing framework powered by Vite
The postgres client/server binary protocol, implemented in TypeScript
Connection pool for node-postgres
Module for reading .pgpass
generator async control flow goodness
A slightly nicer interface to Postgres over node-libpq
TypeScript typings for Cloudflare Workers
the complete solution for node.js command-line programs
Lodash modular utilities.
An AST-based pattern checker for JavaScript.
A tiny (183B to 210B) and fast utility to ascend parent directories
Release history
13 releases in the last two years, typically about 33 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.14.0latest | 2 months ago | 16 KB | MIT |
| 2.13.0 | 3 months ago | 15 KB | MIT |
| 2.12.0 | 6 months ago | 15 KB | MIT |
| 2.11.0 | 7 months ago | 15 KB | MIT |
| 2.10.1 | 7 months ago | 15 KB | MIT |
| 2.10.0 | 7 months ago | 15 KB | MIT |
| 2.9.1 | 1 year ago | 15 KB | MIT |
| 2.9.0 | 1 year ago | 14 KB | MIT |
| 2.8.5 | 1 year ago | 15 KB | MIT |
| 2.8.2 | 1 year ago | 15 KB | MIT |
| 2.8.1 | 1 year ago | 15 KB | MIT |
| 2.8.0 | 1 year ago | 15 KB | MIT |
| 2.7.1-alpha.0 | 1 year ago | 15 KB | MIT |
| 2.7.0 | 2 years ago | 8.9 KB | MIT |
| 2.6.4 | 2 years ago | 8.9 KB | MIT |
Overview
pg-connection-string is an npm package that functions for dealing with a PostgreSQL connection string. It is extremely widely used, with about 38.9M downloads per week and 2 known dependents in the graph. The latest version is 2.14.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need functions for dealing with a PostgreSQL connection string and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (38.9M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Keywords
Frequently asked questions
Should I use pg-connection-string?
Yes — pg-connection-string scores well across adoption, maintenance, weight, supply chain, and licensing. 38.9M downloads per week and 2 known dependents. Last published 83 days ago. 14 releases in the last 2 years.
How do I install pg-connection-string?
Run `npm install pg-connection-string` to add pg-connection-string to your npm project.
What license is pg-connection-string released under?
pg-connection-string is distributed under the MIT license.
How popular is pg-connection-string?
pg-connection-string has approximately 38,911,519 downloads per week and 2 known dependent packages.
Is pg-connection-string still maintained?
The most recent release of pg-connection-string (v2.14.0) was published 2 months ago.
Does pg-connection-string run install scripts?
No. pg-connection-string does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.