Skip to content

zenxds/redis-promisify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-promisify

promisify redis commands with util.promisify

redis-promisify will add promisified method(client[command + 'Async'], such as client.setAsync) for client and multi

install

npm i redis-promisify --save

Usage

const redis = require('redis-promisify')
const client = redis.createClient({
  host: '127.0.0.1',
  port: 6379,
  db: 0
})

client.setAsync("string key", "string val").then((reply) => {
  console.log(reply)
})
client.multi().get('string key').execAsync().then((replies) => {
  console.log(replies)
})

commands

client commands: redis-commands

multi commands: ['execAtomicAsync', 'execAsync']

About

promisify redis commands with util.promisify

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published