Parses Redis URL into a node_redis config object

npm install parse-redis-url
2 downloads in the last week
13 downloads in the last month


A module for parsing redis://.. URLs into node_redis-friendly options.

Can also create actual client instance for your convenience.

Build Status


var redis = require('redis');
var parseRedisUrl = require('parse-redis-url')(redis);
var url = 'redis://';

// create a new client from URL

parseRedisUrl.createClient(url, function(err, client) {
   if (err) return callback(err);
   // do something with client

// simply parse URL for connection options
// please note that username is not used by Redis,
// so it's not included in the result

var options = parseRedisUrl.parse(url);
// { host: '',
//  port: 5555,
//  password: 'password',
//  database: 42 }
npm loves you