0.1.2 • Published 5 years ago

redis-promisify v0.1.2

Weekly downloads
680
License
ISC
Repository
github
Last release
5 years ago

redis-promisify

promisify redis commands with util.promisify

redis-promisify will add promisified method(clientcommand + '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'