{"name":"pg-connection-string","version":"2.4.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"},"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":"7ffe68eba056b9a6d0fa88f928aa85e768c28838","_id":"pg-connection-string@2.4.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.19.0/node@v12.18.2+x64 (darwin)","dist":{"integrity":"sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ==","shasum":"c979922eb47832999a204da5dbe1ebf2341b6a10","tarball":"http://registry-npm.ywwl.com/pg-connection-string/download/pg-connection-string-2.4.0.tgz","fileCount":5,"unpackedSize":8439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeiIDCRA9TVsSAnZWagAAl5EQAIXbNfX/grZ0tulWdN3m\nXLD8MT+Z8ylnPQ7vmT7WmxzmkA+yUp40hhwr9JPFaC9Jx6yGDvbII3WdAA7O\nWp9hdMszmolNH+HYwdGYzbqLwX+PHSowfqy4OPvZ7hc1NtAhoEXS5eKvMSeA\nmnx7qVwAT7WZ7uEDADAC/Pa5peaLehcwLFxlj966yV6MbZzyeG7Z6SBFy37l\ng/Dk+o2xtrtVKPdpz11x9kQecG7/bHuSauc1GzK0Q6QrEf4sYMhKw2kP6xRI\nAWj5EU6QW/XRc5QNk+b7wqhWdTkkHa/bDBPecZwvaBHcmgi5eEN2Q6wCugIU\nzsVfC2uJ+quy5UO4fZnJoHrVZmmcB1Stl2yelHB2iCuiu+tMD/NdAcvnQd6f\nhxu8ovSZlzP89HGMMiMzM1DnRXURo0IJ0puARjPBQFK5g1fWrNZ0mwznodnn\nuIamh2lqQiBpgdJvSeP0MwxVlq2IHGMOxRYdF/7a/2z82w4rPaSC6ydedyus\n64+t6Ixb2Rv/PdZs1b9yfzsx07nmNAsEgUw6UmR7KTX24eI9WpEsBDO45jPS\ndDwhKZVXrLkXEtMRsAF8s6yV5HDS7rm3XfEQ4zUR5BGG806S9vvnK3HS9tv8\nWSsYkieE1p6C2qIWBqDAVOQDgotNP5QVWkKre+j6NdkkarymI8JriNCHCxUH\nD8G2\r\n=tnWc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNf7lzyHLV03GX0+urEAV2xBq6RYKukLG8lKy6rY/wUQIhAPR3uFE88/GqHDwMBC9Waz5uiVSbu2zTQqF9FFX6dWJN"}],"size":3604,"noattachment":false,"key":"/pg-connection-string/-/pg-connection-string-2.4.0.tgz"},"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"}],"_npmUser":{"name":"brianc","email":"brian.m.carlson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-connection-string_2.4.0_1601839618526_0.09175194150332655"},"_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":1601839618647,"_cnpm_publish_time":1601839618647,"dist-tags":{"beta":"2.7.1-alpha.0","latest":"2.14.1"}}