{"name":"pg-connection-string","version":"2.6.3","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":"^7.1.2"},"gitHead":"b03c071d2d15af259e1e008e9628191c865e58fa","_id":"pg-connection-string@2.6.3","_nodeVersion":"20.10.0","_npmVersion":"lerna/3.22.1/node@v20.10.0+arm64 (darwin)","dist":{"integrity":"sha512-77FxhhKJQH+xJx6tDqkhhMa0nZvv3U1HYLDQgwZxZafVD583++O5LXn5oo5HaQZ0vXwYcZA1koYAJM3JvD6Gtw==","shasum":"0393c04b00262bca1d656694f9193aaba9f17fb4","tarball":"http://registry-npm.ywwl.com/pg-connection-string/download/pg-connection-string-2.6.3.tgz","fileCount":5,"unpackedSize":9127,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdYqyh60L6Sd0V8v9/HeSm68qyLusuGQpJKg6NZAH+QAIgD+p5nErZBHHLxVA5xoBu6e+fo6iSYFhW+zct8hbmQJg="}],"size":3786,"noattachment":false,"key":"/pg-connection-string/-/pg-connection-string-2.6.3.tgz"},"_npmUser":{"name":"brianc","email":"brian.m.carlson@gmail.com"},"directories":{},"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"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-connection-string_2.6.3_1711831238323_0.6256808161209084"},"_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* `host` - Postgres server hostname or, for UNIX domain sockets, the socket filename\n* `port` - port on which to connect\n* `user` - User with which to authenticate to the server\n* `password` - Corresponding password\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":1711831238456,"_cnpm_publish_time":1711831238456,"dist-tags":{"beta":"2.7.1-alpha.0","latest":"2.14.1"}}