parse-rethinkdb-url
v0.0.1parse-rethinkdb-url
Parse RethinkDB URL string into an object ready for consumption by RethinkDB JavaScript API.
Installation
npm install --save parse-rethinkdb-url
Usage
var r = require('rethinkdb');
var parseRethinkdbUrl = require('parse-rethinkdb-url');
var options = parseRethinkdbUrl('rethinkdb://AzureDiamond:hunter2@localhost:28015/marvel');
// { host: 'localhost',
// port: 28015,
// db: 'marvel',
// authKey: 'hunter2' }
r.connect(options, function(err, conn) { ... });
Please note that when using authentication both username and password must be provided. Username is ignored while password is used as authKey.
npm i parse-rethinkdb-url
Metadata
- MIT
- Whatever
- George Miroshnykov
- released 3/26/2015