{"name":"pg-connection-string","version":"2.1.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+https://github.com/iceddev/pg-connection-string.git"},"keywords":["pg","connection","string","parse"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/iceddev/pg-connection-string/issues"},"homepage":"https://github.com/iceddev/pg-connection-string","dependencies":{},"devDependencies":{"chai":"^4.1.1","istanbul":"^0.4.5","mocha":"^3.5.0"},"gitHead":"06c46ac12b2a9540483450305f841938a759ba4d","_id":"pg-connection-string@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.16.0","_npmUser":{"name":"bowerman","email":"me@andrewbowerman.com"},"dist":{"integrity":"sha512-bhlV7Eq09JrRIvo1eKngpwuqKtJnNhZdpdOlvrPrA4dxqXPjxSrbNrfnIDmTpwMyRszrcV4kU5ZA4mMsQUrjdg==","shasum":"e07258f280476540b24818ebb5dca29e101ca502","tarball":"http://registry-npm.ywwl.com/pg-connection-string/download/pg-connection-string-2.1.0.tgz","fileCount":5,"unpackedSize":5343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCaj1CRA9TVsSAnZWagAA6CwP/jbpjuQIrf2iVRD6HxuK\nZvT2BcSWwU2Pii5fbOrd4aSo9TfdG01sheJ3mq5nJ2fPe1xuWmOPXPgoHrPx\nAQ3Jk1173eCOsJKxpyjCm8CXu38JmI7jPJmQR+MWlwfP7nB1FQyQBdU8sYFm\nm/yFTaJq52ddbZCdfHFReNMfZyz+c2voePZF3fCWc3R4/NRQALqzkb/Wx2/K\nWWw/F/ECBmWO4eEb3Z9Whjm5rNKBAj8ntfGfpZkhyE6PTWQR+/MZV4Dy4pGM\nW6fnM8+CZh+ob2FpCPPirver93OFleKuN4ddxBJIirIWUD5NL0j93m/QqZeu\nDPnSFvgV/ASiMsCsCAVrfyCU+YBU/yWsIa+USOkUvFztMFq2PlDVONa4eHyN\n15+J8vbGNJsjr9VIl7IvoeQ5oqPzvPRZXpp0rO90MfpxCyuBPnVvFvq7UBfB\nBvXIsW/avOL/KA1Hhn00E1L+4o9R4kRVy2oi10vqh3WEwRkNPyMW7V2y5+db\n205tAqqKTf7J+l/Utq7DXI0yS1Ymb8+pXlpFVkkPxl9v12FX00Aa4sxkTQKM\nhFOZXwHS31mQqwGBBV3V06ibYIoN7ZnyRr1BzKscV3xkcDY+mkR6GYp69nn5\nLMS8rcZkAluj1tHxvYCTm+BklJr5ljWjnTPof8gLey4b1XzekVdoE4oiZGXG\n6b7F\r\n=cY5B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA98x76PcFrQlfwRRGw4HeYhTaXluK7460tssGE4fGjTAiEA5UhMJUnvOFpg2shIn9qeixl64BWOtnFsA4GeVZEzGhE="}],"size":2459,"noattachment":false,"key":"/pg-connection-string/-/pg-connection-string-2.1.0.tgz"},"maintainers":[{"email":"me@andrewbowerman.com","name":"bowerman"},{"email":"herman@hermanradtke.com","name":"hjr3"},{"email":"monteslu@gmail.com","name":"monteslu"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-connection-string_2.1.0_1560914164608_0.810017310577176"},"_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":1560914164723,"_cnpm_publish_time":1560914164723,"dist-tags":{"beta":"2.7.1-alpha.0","latest":"2.14.1"}}