Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

screencom/node-redis-wrapper

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-redis-wrapper

A small, promise-based, pooled wrapper for the redis module: we re-use the same code across a bunch of modules, hence this abstraction.

Usage

Given a confg object such as:

host: redis
port: 6379
pool:
  max: 20
  min: 2
  acquireTimeoutMillis: 3000

You can then start using redis with:

const redis = require('node-redis-wrapper')(config)

redis.del('some-key').then(...).catch(...)

// or with async/await

await redis.del('some-key')

Custom constructor

If you want to control how the redis client is created (eg. to use redis-sentinel & the likes), you can just specify a createClient function in the config:

let config = {...}

config.createClient = function() {
  require('redis-sentinel').createClient(...options...)
}

const redis = require('node-redis-wrapper')(config)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.