# muri

> MongoDB URI parser

Latest version **1.3.0** (published 2017-10-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install muri
pnpm add muri
yarn add muri
bun add muri
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2017-10-10 |
| First published | 2012-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/muri) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Aaron Heckmann |
| Maintainers | aaron, vkarpov15 |
| Keywords | mongodb, uri, parser |

## Links

- npm: https://www.npmjs.com/package/muri
- Repository: https://github.com/aheckmann/muri
- Homepage: https://github.com/aheckmann/muri#readme
- Issues: https://github.com/aheckmann/muri/issues
- npm.io page: https://npm.io/package/muri

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.3.0 (latest) — 2017-10-10
- 1.2.2 — 2017-07-05
- 1.2.1 — 2017-02-02
- 1.2.0 — 2017-01-16
- 1.1.1 — 2016-09-26
- 1.1.0 — 2015-04-13
- 1.0.0 — 2014-10-18
- 0.3.1 — 2013-02-17
- 0.3.0 — 2013-01-14
- 0.2.0 — 2013-01-09
- 0.1.0 — 2012-12-18
- 0.0.5 — 2012-12-18
- 0.0.4 — 2012-12-01
- 0.0.3 — 2012-11-30
- 0.0.2 — 2012-11-02
- … 1 more at https://npm.io/package/muri/versions

## README

# Meet Muri!

Muri is your friendly neighborhood [MongoDB URI](http://www.mongodb.org/display/DOCS/Connections) parser for Node.js.


### Install

    $ npm install muri

### Use

```js
 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

[MIT](https://github.com/aheckmann/muri/blob/master/LICENSE)

---
_Source: https://npm.io/package/muri · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
