Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

make-redis-client

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

make-redis-client

Provides a simple factory function that returns a redis client instance

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

NPM info

dependencies

Provides a simple factory function that returns a redis client instance

Install

$ npm install --save make-redis-client

Usage

Call the exported function with a plain object containing the properties you want your redis client to be configured with. It returns a redisClient.

In addition to the config options from redis, you can also define the database you want to select in redis.

Valid Options


var validRedisOptions = [
	'unixSocket', // if this is presented, host and port are ignored
	'host',
	'port',
	'parser',
	'return_buffers',
	'detect_buffers',
	'socket_nodelay',
	'socket_keepalive',
	'no_ready_check',
	'enable_offline_queue',
	'retry_max_delay',
	'connect_timeout',
	'max_attempts',
	'auth_pass',
	'family',
	'db'
];

Example

var makeRedisClient = require('make-redis-client');

var client = makeRedisClient({
	host: '127.0.0.1',
	port: 6379,
	db: 5,
	connect_timeout: 300
});

client.get('foo', function(err, result) {
	console.log(result);
});

License

MIT © Benjamin Kroeger

Keywords

make-redis-client

FAQs

Package last updated on 11 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts