Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

muri

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

muri

MongoDB URI parser

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

#Meet Muri!

Muri is your friendly neighborhood MongoDB URI parser for Node.js.

###Install

$ npm install muri

###Use

 var muri = require('muri');
 var o = muri('mongodb://user:pass@local,remote:27018,japan:27019/neatdb?replicaSet=myreplset&journal=true&w=2&wtimeoutMS=50');

 console.log(o);

 { hosts: [ { host: 'local',  port: 27017 },
            { host: 'remote', port: 27018 },
            { host: 'japan',  port: 27019 } ],
   db: 'neatdb',
   options: {
     replicaSet: 'myreplset',
     journal: true,
     w: 2,
     wtimeoutMS: 50
   },
   auth: {
     user: 'user',
     pass: 'pass'
   }
 }

Details

The returned object contains the following properties:

  • db: the name of the database. defaults to "admin" if not specified
  • auth: if auth is specified, this object will exist { user: 'username', pass: 'password' }
  • hosts: array of host/port objects, one for each specified [{ host: 'local', port: 27107 }, { host: '..', port: port }]
    • if a port is not specified for a given host, the default port (27017) is used
    • if a unix domain socket is passed, host/port will be undefined and ipc will be set to the value specified [{ ipc: '/tmp/mongodb-27017' }]
  • options: this is a hash of all options specified in the querystring

LICENSE

Keywords

FAQs

Package last updated on 02 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc