{"name":"pg-connection-string","version":"2.7.0","description":"Functions for dealing with a PostgresSQL connection string","main":"./index.js","types":"./index.d.ts","scripts":{"test":"istanbul cover _mocha && npm run check-coverage","check-coverage":"istanbul check-coverage --statements 100 --branches 100 --lines 100 --functions 100","coveralls":"cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"},"repository":{"type":"git","url":"git://github.com/brianc/node-postgres.git","directory":"packages/pg-connection-string"},"keywords":["pg","connection","string","parse"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/brianc/node-postgres/issues"},"homepage":"https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string","devDependencies":{"chai":"^4.1.1","coveralls":"^3.0.4","istanbul":"^0.4.5","mocha":"^10.5.2"},"gitHead":"92cb640fd316972e323ced6256b2acd89b1b58e0","_id":"pg-connection-string@2.7.0","_nodeVersion":"22.2.0","_npmVersion":"lerna/3.22.1/node@v22.2.0+arm64 (darwin)","dist":{"integrity":"sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==","shasum":"f1d3489e427c62ece022dba98d5262efcb168b37","tarball":"http://registry-npm.ywwl.com/pg-connection-string/download/pg-connection-string-2.7.0.tgz","fileCount":5,"unpackedSize":9098,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDwQaE725Oe+7h/hN+OACwINqGSg0wH1npoIY+RQlXgwIhALqfvdpenUiSZyeIx17y4c/MKdZBjOzEGJp0u5eKdTbm"}],"size":3770,"noattachment":false,"key":"/pg-connection-string/-/pg-connection-string-2.7.0.tgz"},"_npmUser":{"name":"brianc","email":"brian.m.carlson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-connection-string_2.7.0_1726585753836_0.3431343315207058"},"_hasShrinkwrap":false,"readme":"pg-connection-string\n====================\n\n[![NPM](https://nodei.co/npm/pg-connection-string.png?compact=true)](https://nodei.co/npm/pg-connection-string/)\n\n[![Build Status](https://travis-ci.org/iceddev/pg-connection-string.svg?branch=master)](https://travis-ci.org/iceddev/pg-connection-string)\n[![Coverage Status](https://coveralls.io/repos/github/iceddev/pg-connection-string/badge.svg?branch=master)](https://coveralls.io/github/iceddev/pg-connection-string?branch=master)\n\nFunctions for dealing with a PostgresSQL connection string\n\n`parse` method taken from [node-postgres](https://github.com/brianc/node-postgres.git)\nCopyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)\nMIT License\n\n## Usage\n\n```js\nvar parse = require('pg-connection-string').parse;\n\nvar config = parse('postgres://someuser:somepassword@somehost:381/somedatabase')\n```\n\nThe resulting config contains a subset of the following properties:\n\n* `user` - User with which to authenticate to the server\n* `password` - Corresponding password\n* `host` - Postgres server hostname or, for UNIX domain sockets, the socket filename\n* `port` - port on which to connect\n* `database` - Database name within the server\n* `client_encoding` - string encoding the client will use\n* `ssl`, either a boolean or an object with properties\n  * `rejectUnauthorized`\n  * `cert`\n  * `key`\n  * `ca`\n* any other query parameters (for example, `application_name`) are preserved intact.\n\n## Connection Strings\n\nThe short summary of acceptable URLs is:\n\n * `socket:<path>?<query>` - UNIX domain socket\n * `postgres://<user>:<password>@<host>:<port>/<database>?<query>` - TCP connection\n\nBut see below for more details.\n\n### UNIX Domain Sockets\n\nWhen user and password are not given, the socket path follows `socket:`, as in `socket:/var/run/pgsql`.\nThis form can be shortened to just a path: `/var/run/pgsql`.\n\nWhen user and password are given, they are included in the typical URL positions, with an empty `host`, as in `socket://user:pass@/var/run/pgsql`.\n\nQuery parameters follow a `?` character, including the following special query parameters:\n\n * `db=<database>` - sets the database name (urlencoded)\n * `encoding=<encoding>` - sets the `client_encoding` property\n\n### TCP Connections\n\nTCP connections to the Postgres server are indicated with `pg:` or `postgres:` schemes (in fact, any scheme but `socket:` is accepted).\nIf username and password are included, they should be urlencoded.\nThe database name, however, should *not* be urlencoded.\n\nQuery parameters follow a `?` character, including the following special query parameters:\n * `host=<host>` - sets `host` property, overriding the URL's host\n * `encoding=<encoding>` - sets the `client_encoding` property\n * `ssl=1`, `ssl=true`, `ssl=0`, `ssl=false` - sets `ssl` to true or false, accordingly\n * `sslmode=<sslmode>`\n   * `sslmode=disable` - sets `ssl` to false\n   * `sslmode=no-verify` - sets `ssl` to `{ rejectUnauthorized: false }`\n   * `sslmode=prefer`, `sslmode=require`, `sslmode=verify-ca`, `sslmode=verify-full` - sets `ssl` to true\n * `sslcert=<filename>` - reads data from the given file and includes the result as `ssl.cert`\n * `sslkey=<filename>` - reads data from the given file and includes the result as `ssl.key`\n * `sslrootcert=<filename>` - reads data from the given file and includes the result as `ssl.ca`\n\nA bare relative URL, such as `salesdata`, will indicate a database name while leaving other properties empty.\n","publish_time":1726585754074,"maintainers":[{"name":"hjr3","email":"herman@hermanradtke.com"},{"name":"monteslu","email":"monteslu@gmail.com"},{"name":"brianc","email":"brian.m.carlson@gmail.com"},{"name":"bowerman","email":"me@andrewbowerman.com"}],"_cnpm_publish_time":1726585754074,"dist-tags":{"beta":"2.7.1-alpha.0","latest":"2.14.1"}}