{"_id":"mongodb-uri","_rev":"43-fb15aa54c6cd265a2f6fab20b63ce4be","name":"mongodb-uri","description":"A parser and formatter for MongoDB URIs.","dist-tags":{"latest":"0.9.7"},"versions":{"0.9.0":{"name":"mongodb-uri","version":"0.9.0","description":"A parser and formatter for MongoDB URIs.","keywords":["mongodb","uri","url","parser","formatter"],"author":{"name":"MongoLab","email":"support@mongolab.com"},"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","license":"MIT","main":"mongodb-uri","devDependencies":{"jake":"0.5.x","mocha":"1.9.x","should":"1.2.x","jake-mocha":"0.9.x"},"scripts":{"test":"jake --trace"},"engines":{"node":">= 0.6.0"},"_id":"mongodb-uri@0.9.0","dist":{"shasum":"5d2770efcb661e9d324333eb5cba0848cb759bf9","tarball":"https://registry.npmjs.org/mongodb-uri/-/mongodb-uri-0.9.0.tgz","integrity":"sha512-Jd20gaSZJCJq/QY1f+Zjl8Qd+vbUdtfoTB9uvKwz7/bSPxzQOMqIgGsU+hgBKjVGBkHF7g2AKy4XuTqVNEmWNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDj0NK8eNoX/I0S56cLRQKLuCymCTxwdFJhVC4Q0dfIPAiAHQuNOe1rhAogxKz8G5+bUAzBvEd49QsecijUcVCZYeg=="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"jcottr","email":"jcottr@gmail.com"},"maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}]},"0.9.1":{"name":"mongodb-uri","version":"0.9.1","description":"A parser and formatter for MongoDB URIs.","keywords":["mongodb","uri","url","parser","formatter","mongoose"],"author":{"name":"MongoLab","email":"support@mongolab.com"},"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","license":"MIT","main":"mongodb-uri","devDependencies":{"jake":"0.5.x","mocha":"1.9.x","should":"1.2.x","jake-mocha":"0.9.x"},"scripts":{"test":"jake --trace"},"engines":{"node":">= 0.6.0"},"bugs":{"url":"https://github.com/mongolab/mongodb-uri-node/issues"},"_id":"mongodb-uri@0.9.1","dist":{"shasum":"847bd45ebaabba5ec929ecb54b9b3b709392df88","tarball":"https://registry.npmjs.org/mongodb-uri/-/mongodb-uri-0.9.1.tgz","integrity":"sha512-IRTOYCUyExoIUDEREXRNkRysNKLMRTsqEd04XnNiiJRrbeL0V4UFk3i3ODCbiwxGWGz6NUVweVeJlkgSMTiWkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzXdd5dDCj5eCf/yBZWTPwV834nc65BpRCIaOLsYMPwgIgZoyN+sMo4bUCYperNW9SH3M/TWklXRzOtPJkUQuruTU="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"jcottr","email":"jcottr@gmail.com"},"maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}]},"0.9.3":{"name":"mongodb-uri","version":"0.9.3","description":"A parser and formatter for MongoDB URIs.","keywords":["mongodb","uri","url","parser","formatter","mongoose"],"author":{"name":"MongoLab","email":"support@mongolab.com"},"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","license":"MIT","main":"mongodb-uri","devDependencies":{"jake":"0.5.x","mocha":"1.9.x","should":"1.2.x","jake-mocha":"0.9.x"},"scripts":{"test":"jake --trace"},"engines":{"node":">= 0.6.0"},"bugs":{"url":"https://github.com/mongolab/mongodb-uri-node/issues"},"_id":"mongodb-uri@0.9.3","dist":{"shasum":"77b4374db508edf15f37067a31fc4abeac71ec3d","tarball":"https://registry.npmjs.org/mongodb-uri/-/mongodb-uri-0.9.3.tgz","integrity":"sha512-iQ+wfTGcshunLp6Kw7+fKcqEjoxWEjjubgVFKEtJSWz30W2bAATOyi00Nb95oPPQ1AoUBg3XBLv/0IuWP86Csg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIESrKdX9kfDwULo+ZkreoGEhManUxVEbbuu1v//2v1rtAiEA9A8d3ld/UnUEaib8BRvlxQB6EYVgnaed7ODTddIRHb0="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"jcottr","email":"jcottr@gmail.com"},"maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}]},"0.9.4":{"name":"mongodb-uri","version":"0.9.4","description":"A parser and formatter for MongoDB URIs.","keywords":["mongodb","uri","url","parser","formatter","mongoose"],"author":{"name":"MongoLab","email":"support@mongolab.com"},"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","license":"MIT","main":"mongodb-uri","devDependencies":{"jake":"0.5.x","mocha":"1.9.x","should":"1.2.x","jake-mocha":"0.9.x"},"scripts":{"test":"jake --trace"},"engines":{"node":">= 0.6.0"},"bugs":{"url":"https://github.com/mongolab/mongodb-uri-node/issues"},"_id":"mongodb-uri@0.9.4","dist":{"shasum":"a60b666c17d34a039931c182cc2ad6865f87e2a0","tarball":"https://registry.npmjs.org/mongodb-uri/-/mongodb-uri-0.9.4.tgz","integrity":"sha512-y2yFHBVJNwWYPZ1yphh31C6XGav6Nc3qQTGOBbEB8k/mSHcLQcfkK9a57h7QcvYLA0k/2VTWR0rvKV79QId5NA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmAl2b2qdJAV8vtSPRnR3daEerJubiqTIotihg4hp8LgIhAPS1k90qZ10+J20bFUhYIuwSomPgnrgapMmqKb6m6xPS"}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"jcottr","email":"jcottr@gmail.com"},"maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}]},"0.9.5":{"name":"mongodb-uri","version":"0.9.5","description":"A parser and formatter for MongoDB URIs.","keywords":["mongodb","uri","url","parser","formatter","mongoose"],"author":{"name":"MongoLab","email":"support@mongolab.com"},"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","license":"MIT","main":"mongodb-uri","devDependencies":{"jake":"0.5.x","mocha":"1.9.x","should":"1.2.x","jake-mocha":"0.9.x"},"scripts":{"test":"jake --trace"},"engines":{"node":">= 0.6.0"},"bugs":{"url":"https://github.com/mongolab/mongodb-uri-node/issues"},"_id":"mongodb-uri@0.9.5","dist":{"shasum":"ad4169e4afcc660771beab6dfbc4209fe51e81d6","tarball":"https://registry.npmjs.org/mongodb-uri/-/mongodb-uri-0.9.5.tgz","integrity":"sha512-hm+AWqgMWkZLEGOvrp3L3FKj42ofzkh63DGrgTwlATMl/5NzwZ4S6QR10uyiPTrtfPmZDB5mozwHDC0TatDDIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUzVZ/7/6sbyQhLyY1ourHNH+nqV2zMc+w8wYE6upvIAiA9JKhEbnrCNvg6hu6HOxkWkcvHxzOgy8t2qJN7Eswkfg=="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"jcottr","email":"jcottr@gmail.com"},"maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}]},"0.9.6":{"name":"mongodb-uri","version":"0.9.6","description":"A parser and formatter for MongoDB URIs.","keywords":["mongodb","uri","url","parser","formatter","mongoose"],"author":{"name":"MongoLab","email":"support@mongolab.com"},"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","license":"MIT","main":"mongodb-uri","devDependencies":{"jake":"0.5.x","mocha":"1.9.x","should":"1.2.x","jake-mocha":"0.9.x"},"scripts":{"test":"jake --trace"},"engines":{"node":">= 0.6.0"},"bugs":{"url":"https://github.com/mongolab/mongodb-uri-node/issues"},"_id":"mongodb-uri@0.9.6","dist":{"shasum":"5af865cd74649181af46f9f0c232d2b521b83173","tarball":"https://registry.npmjs.org/mongodb-uri/-/mongodb-uri-0.9.6.tgz","integrity":"sha512-SiPC7TcGN5WDhEZ8GU8EtlgAa4Psf/p9vBN/H47HR6hhSgmVNu730D2InEfImTMsjFm3kmjhQMOfkHEwglLubw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF3sLX3NZPlAIzIKjU4oVDeja2hAdiLDgCc1g1AKdghwAiEAk7sVCDRHidgimd7/UWKZLN+7UkUj0m9jF3D6oGCAo2A="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"jcottr","email":"jcottr@gmail.com"},"maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}]},"0.9.7":{"name":"mongodb-uri","version":"0.9.7","description":"A parser and formatter for MongoDB URIs.","keywords":["mongodb","uri","url","parser","formatter","mongoose"],"author":{"name":"MongoLab","email":"support@mongolab.com"},"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","license":"MIT","main":"mongodb-uri","devDependencies":{"jake":"0.5.x","mocha":"1.9.x","should":"1.2.x","jake-mocha":"0.9.x"},"scripts":{"test":"jake --trace"},"engines":{"node":">= 0.6.0"},"gitHead":"2f4fcd3c703fe016d35e7e58254ad6c7feffeaa8","bugs":{"url":"https://github.com/mongolab/mongodb-uri-node/issues"},"_id":"mongodb-uri@0.9.7","_shasum":"0f771ad16f483ae65f4287969428e9fbc4aa6181","_from":".","_npmVersion":"1.4.15","_npmUser":{"name":"jcottr","email":"jcottr@gmail.com"},"maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}],"dist":{"shasum":"0f771ad16f483ae65f4287969428e9fbc4aa6181","tarball":"https://registry.npmjs.org/mongodb-uri/-/mongodb-uri-0.9.7.tgz","integrity":"sha512-s6BdnqNoEYfViPJgkH85X5Nw5NpzxN8hoflKLweNa7vBxt2V7kaS06d74pAtqDxde8fn4r9h4dNdLiFGoNV0KA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5RJDc07Ly9ULj7/nAFr7GGfrYiuLmdpWP4Lc7wI+e8AIhAMUqAEjjZaqzbn2lROilQY/CLTjFvTIQZarxA/B6G0CO"}]}}},"readme":"# mongodb-uri\n\nParse and format MongoDB URIs of the form:\n\n```\nmongodb://[username[:password]@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database]][?options]\n```\n\nNote that there are two minor differences between this format and the\n[standard MongoDB connect string URI format](http://docs.mongodb.org/manual/reference/connection-string/):\n\n1. `password` is optional even when a `username` is supplied\n2. The slash before the `database` is not required when leaving out the `database` but specifying `options`\n\nNeither of these differences should prevent this library from parsing any URI conforming to the standard format.\n\n## Usage\n\n### parse\n\nTakes a URI string and returns a URI object of the form:\n\n```\n{\n  scheme: !String,\n  username: String=,\n  password: String=,\n  hosts: [ { host: !String, port: Number= }, ... ],\n  database: String=,\n  options: Object=\n}\n```\n\n`scheme` and `hosts` will always be present. Other fields will only be present in the result if they were present in the\ninput.\n\n#### Example\n\n```javascript\nvar mongodbUri = require('mongodb-uri');\nvar uri = 'mongodb://user%3An%40me:p%40ssword@host:1234/d%40tabase?authSource=%40dmin';\nvar uriObject = mongodbUri.parse(uri);\nconsole.log(JSON.stringify(uriObject, null, 2));\n```\n\n```\n{\n  \"scheme\": \"mongodb\",\n  \"hosts\": [\n    {\n      \"host\": \"host\",\n      \"port\": 1234\n    }\n  ],\n  \"username\": \"user:n@me\",\n  \"password\": \"p@ssword\",\n  \"options\": {\n    \"authSource\": \"@dmin\"\n  },\n  \"database\": \"d@tabase\"\n}\n```\n\n### format\n\nTakes a URI object and returns a URI string.\n\n#### Example\n\n```javascript\nvar mongodbUri = require('mongodb-uri');\nvar uri = mongodbUri.format(\n        {\n            username: 'user:n@me',\n            password: 'p@ssword',\n            hosts: [\n                {\n                    host: 'host',\n                    port: 1234\n                }\n            ],\n            database: 'd@tabase',\n            options: {\n                authSource: '@dmin'\n            }\n        }\n);\nconsole.log(uri);\n```\n\n```\nmongodb://user%3An%40me:p%40ssword@host:1234/d%40tabase?authSource=%40dmin\n```\n\n### formatMongoose\n\nTakes either a URI object or string and returns a Mongoose connection string. Specifically, instead of listing all hosts\nand ports in a single URI, a Mongoose connection string contains a list of URIs each with a single host and port pair.\n\nUseful in environments where a MongoDB URI environment variable is provided, but needs to be programmatically\ntransformed into a string digestible by [mongoose.connect()](http://mongoosejs.com/docs/connections.html)--for example,\nwhen deploying to a [PaaS like Heroku using a MongoDB add-on like MongoLab](https://devcenter.heroku.com/articles/mongolab).\n\n#### Example\n\n```javascript\nvar mongoose = require('mongoose');\nvar mongodbUri = require('mongodb-uri');\n\n// A MongoDB URI, not compatible with Mongoose because it lists multiple hosts in the address\n// Could be pulled from an environment variable or config file\nvar uri = 'mongodb://username:password@host1:1234,host2:5678/database';\n\n// Reformat to a Mongoose connect string and connect()\nvar mongooseConnectString = mongodbUri.formatMongoose(uri);\nmongoose.connect(mongooseConnectString);\n\n// Test for connection success\nvar db = mongoose.connection;\ndb.on('error', console.error.bind(console, 'Connection error: '));\ndb.once('open', function callback () {\n    console.log('Successfully connected to MongoDB');\n});\n```\n","maintainers":[{"name":"jcottr","email":"jcottr@gmail.com"}],"time":{"modified":"2022-06-20T06:36:34.769Z","created":"2013-06-04T20:01:26.550Z","0.9.0":"2013-06-04T20:01:27.717Z","0.9.1":"2014-04-03T00:37:14.675Z","0.9.3":"2014-04-03T18:08:17.646Z","0.9.4":"2014-04-03T19:51:52.741Z","0.9.5":"2014-04-04T20:24:39.491Z","0.9.6":"2014-04-22T17:04:57.028Z","0.9.7":"2014-06-11T22:15:12.326Z"},"author":{"name":"MongoLab","email":"support@mongolab.com"},"repository":{"type":"git","url":"https://github.com/mongolab/mongodb-uri-node.git"},"homepage":"https://github.com/mongolab/mongodb-uri-node","keywords":["mongodb","uri","url","parser","formatter","mongoose"],"contributors":[{"name":"Jared D. Cottrell","email":"jared@mongolab.com"}],"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/mongolab/mongodb-uri-node/issues"},"users":{"djensen47":true,"siyb":true,"shakefu":true,"ajduke":true,"hengkiardo":true,"hain":true}}