0.0.1 • Published 9 years ago

parse-rethinkdb-url v0.0.1

Weekly downloads
254
License
MIT
Repository
github
Last release
9 years ago

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.