parse-rethinkdb-url

Parse RethinkDB URL string into an object ready for consumption by RethinkDB JavaScript API

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
parse-rethinkdb-url
100.0.19 years ago9 years agoMinified + gzip package size for parse-rethinkdb-url in KB

Readme

parse-rethinkdb-url
Parse RethinkDB URL string into an object ready for consumption by RethinkDB JavaScript API.
Build Status

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.