redis-factory
v1.0.0
Published
A factory for creating a redis client from a connection string.
Downloads
1
Maintainers
Keywords
Readme
redis-factory
A factory for creating a redis client from a connection string.
Installation (via npm)
$ npm install redis-factory
Why?
The de facto node.js redis library library doesn't support creating a client using a redis://username:password@host:port/
-style connection string. This adds that support without hardcoding the version of the redis library you are using, so you an opt into using alternatives such as romis.
Usage
(function () {
'use strict';
var redis = require('redis'),
redisFactory = require('redis-factory'),
connectionString = process.env.REDIS_URI || 'redis://localhost';
module.exports = redisFactory(redis)(connectionString);
}());