{"_id":"mongo-uri","_rev":"16-e9187a0cfe6224174dbc761d8074f04d","name":"mongo-uri","description":"I parse mongo URIs; especially the tricky repl set ones.","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.0":{"name":"mongo-uri","version":"0.0.0","description":"I parse mongo URIs; especially the tricky ones with multiple hosts","main":"lib/index.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"git://github.com/supershabam/mongo-uri"},"keywords":["mongodb","uri","url"],"author":{"name":"Ian Hansen"},"license":"MIT","gitHead":"07d634af7ade5544fd28c98907cd1567b35a9b56","devDependencies":{"grunt-mocha-cli":"~1.0.0","grunt":"~0.4.0","grunt-contrib-coffee":"~0.4.1","coffee-script":"~1.5.0","chai":"~1.5.0","mocha":"~1.8.1"},"_id":"mongo-uri@0.0.0","dist":{"shasum":"91a11ddd060e8a0533d42b1a45803c6a6e7edd8a","tarball":"https://registry.npmjs.org/mongo-uri/-/mongo-uri-0.0.0.tgz","integrity":"sha512-fKAT0ArpJirrBHhecNTZHgKOgKmSzE7fgzBs5BkkA4jgLS5BkAD+x7k7VFX+AL6CVmtUjmDeBGTfdpW2iKzztw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0c1bbaPr0SZid/R/Oi1G9r5e/xofeHveTvlQBMLOIuAIgT+ZXECE3fLFatySca2ymPm6VBG1uo+rt62eUapZ0FzA="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"supershabam","email":"ian@supershabam.com"},"maintainers":[{"name":"supershabam","email":"ian@supershabam.com"}]},"0.1.0":{"name":"mongo-uri","version":"0.1.0","description":"I parse mongo URIs; especially the tricky repl set ones.","main":"lib/index.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"git://github.com/supershabam/mongo-uri"},"keywords":["mongodb","uri","url"],"author":{"name":"Ian Hansen"},"license":"MIT","gitHead":"07d634af7ade5544fd28c98907cd1567b35a9b56","devDependencies":{"grunt-contrib-clean":"~0.4.0","grunt-contrib-coffee":"~0.5.0","chai":"~1.5.0","coffee-script":"~1.5.0","mocha":"~1.8.1","grunt":"~0.4.0"},"engines":{"node":">=0.8"},"_id":"mongo-uri@0.1.0","dist":{"shasum":"ea818a4b976ee7715095ffe42794bc94a8cf3cdc","tarball":"https://registry.npmjs.org/mongo-uri/-/mongo-uri-0.1.0.tgz","integrity":"sha512-0v90yzqL4Nvv8MrMR3WcXz29QWUEt9JQe3z8iR/V3NugIqvs4Ws5j814pep87qP10FFvq9BnEVKnLg8LqsnrxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQ9zjFD0e2E43EIyMMOtpZyRvGMptIePzZPYr8MG8VPAiEAsa5Yty+9JFH2UxZh10FWGPYvIJnxspYmvHTFmCkggcA="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"supershabam","email":"ian@supershabam.com"},"maintainers":[{"name":"supershabam","email":"ian@supershabam.com"}]},"0.1.1":{"name":"mongo-uri","version":"0.1.1","description":"I parse mongo URIs; especially the tricky repl set ones.","main":"lib/index.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"git://github.com/supershabam/mongo-uri"},"keywords":["mongodb","uri","url"],"author":{"name":"Ian Hansen"},"license":"MIT","gitHead":"07d634af7ade5544fd28c98907cd1567b35a9b56","devDependencies":{"grunt-contrib-clean":"~0.4.0","grunt-contrib-coffee":"~0.5.0","chai":"~1.5.0","coffee-script":"~1.5.0","mocha":"~1.8.1","grunt":"~0.4.0"},"engines":{"node":">=0.8"},"_id":"mongo-uri@0.1.1","dist":{"shasum":"22650ba45b7f5b4205881d9b761404cbe8b62b3f","tarball":"https://registry.npmjs.org/mongo-uri/-/mongo-uri-0.1.1.tgz","integrity":"sha512-kzxs9nIoHt+cyIEzrAVKlW5qcG1nZ07uDeTYDRh+g1XTnnPdCBSZu/nf8niYaO5/wNZoTPNhOri+1CPRs8q9VA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHJFlEEg6gLqcOvn0l1H/3XNZn9rxFxMBxanKj7U8jSwIgFxctc3jbAmH2w3sL7z7ThlfbLdjVxn5qOjFCo1ffGwE="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"supershabam","email":"ian@supershabam.com"},"maintainers":[{"name":"supershabam","email":"ian@supershabam.com"}]},"0.1.2":{"name":"mongo-uri","version":"0.1.2","description":"I parse mongo URIs; especially the tricky repl set ones.","main":"lib/index.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"git://github.com/supershabam/mongo-uri"},"keywords":["mongodb","uri","url"],"author":{"name":"Ian Hansen"},"license":"MIT","gitHead":"07d634af7ade5544fd28c98907cd1567b35a9b56","devDependencies":{"grunt-contrib-clean":"~0.4.0","grunt-contrib-coffee":"~0.5.0","chai":"~1.5.0","coffee-script":"~1.5.0","mocha":"~1.8.1","grunt":"~0.4.0"},"engines":{"node":">=0.8"},"_id":"mongo-uri@0.1.2","dist":{"shasum":"173af01403339002e0abd0b4d675987d3cdcf99e","tarball":"https://registry.npmjs.org/mongo-uri/-/mongo-uri-0.1.2.tgz","integrity":"sha512-FehPVi2Dv7VPvAkLnN9haM1aarj1E9w08rkn2MAbbQJF5EbcOckdOHRAD9T35yUkfLVcs0YzYluNX4/+G8HaIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID987+uYRMwb5vebIsxtjDS4duVpZO2Pr1YH01ruHAUpAiEAsNUNtJUmExyQZLvsqa6vLYZ4NCMilNoqzB/uuAdBSq8="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"supershabam","email":"ian@supershabam.com"},"maintainers":[{"name":"supershabam","email":"ian@supershabam.com"}]}},"readme":"mongo-uri\n=========\n\nI parse mongo URIs; especially the tricky repl set ones.  \n[![Build Status](https://travis-ci.org/supershabam/mongo-uri.png?branch=master)](https://travis-ci.org/supershabam/mongo-uri)\n\nDear NodeJS MongoDB Drivers\n---------------------------\n\nI want to use the mongodb connection string... and not just the simple `mongodb://localhost`.\n\nAs it turns out, as soon as you start working with real... non-localhost/side-project\ndeployments, you need to connect to replication sets. Luckily the defined connection\nstring format accomodates such configurations!\n\nSadly, you do not understand these connection strings, or have unacceptable bugs with\nyour parsing (e.g. uris are uri encoded).\n\nSo, I made a uri parser for you.\n\nPlease find bugs in my code, and help me make it the best mongo connection string\nparser in history.\n\nAND THEN USE IT!\n\nHeads up\n--------\n\nI refuse to make assumptions about defaults as part of the parser. So, if a port\ngoes unspecified, I will say that the port is null (because it is), and it is\nyour job to realize that the default port is 27015.\n\nUsage\n-----\n\n```javascript\nvar MongoURI = require('mongo-uri')\n  , uriString\n  , uri\n  ;\n\n// let's deal with a complicated (yet real-life) uri\nuriString = \"mongodb://%40u%2Fs%3Fe%3Ar:p%40a%2Fs%3Fs%3A@example1.com,example2.com,example3.com:27018/?readPreference=secondary&w=2&wtimeoutMS=2000&readPreferenceTags=dc:ny,rack:1&readPreferenceTags=dc:ny&readPreferenceTags=\";\n\ntry {\n  uri = MongoURI.parse(uriString);\n} catch (err) {\n  // handle this correctly, kthxbye\n}\n\nconsole.log(uri);\n/*\n * username: \"@u/s?e:r\" // yay! it got decoded like it was supposed to!\n * password: \"p@a/s?s:\"\n * hosts: [\"example1.com\", \"example2.com\", \"example3.com\"] // wow, multiple hosts!\n * ports: [null, null, 27018] // remember, I don't assume\n * database: null // what did I just say?\n * options: {\n *   readPreference: \"secondary\",\n *   w: \"2\",\n *   timeoutMS: \"2000\",\n *   readPreferenceTags: [\"dc:ny,rack:1\", \"dc:ny\", \"\"] // yeah, this is correct\n * }\n */\n```\n\nSource\n------\n\nOk, so I made a Tweet (which is as good as a promise) that my next npm module would\nbe in [literate coffeescript](http://ashkenas.com/literate-coffeescript/). So,\nI had fun documenting my code, but I *do not* want the .litcoffee to be transpiled\nupon `npm install` of everbody using this code.\n\nGitHub should store the raw source (without the transpiled lib/*.js contents), but\nnpm should store the ready-to-use no-transpiling-needed javascript!\n\nSo, I created a grunt task to do my publishing. Instead of using `npm publish`, I\nuse `grunt publish` which cleans my directory, compiles my .litcoffee files, and\nthen publishes.\n\nSo, don't hate me for using .litcoffee. You're getting raw javascript goodness\nwhen you npm install me.\n\nLicense\n-------\n\nMIT\n","maintainers":[{"name":"supershabam","email":"ian@supershabam.com"}],"time":{"modified":"2022-06-20T06:10:14.226Z","created":"2013-03-01T10:25:23.450Z","0.0.0":"2013-03-01T10:25:24.027Z","0.1.0":"2013-03-02T10:00:57.318Z","0.1.1":"2013-03-02T10:11:30.295Z","0.1.2":"2013-03-02T10:13:36.828Z"},"author":{"name":"Ian Hansen"},"repository":{"type":"git","url":"git://github.com/supershabam/mongo-uri"},"users":{"samueltbrown":true,"fgribreau":true,"marshallswain":true,"markstos":true},"keywords":["mongodb","uri","url"],"license":"MIT","readmeFilename":"README.md"}