@instaffogmbh/verbose-redis

0.1.3 • Public • Published

@instaffogmbh/verbose-redis

ioredis + logging

API

This module exports one function:

vr = makeVerboseRedis(how)

how should be a config object with these keys:

  • logPrefix: Prefix for log and error messages. Required.
  • host, port: Which Redis server to use. Optional.

vr.conn

The lower level redis connection. Can be used to access APIs that don't have a verbose wrapper yet.

vr.teardown()

Terminate the redis connection and clean up. Returns a Promise for being done with cleanup.

exSet = vr.makeExpiringSetter(expirySec[, cond])

Returns an async function (key, val) that sets a key in redis that expires after expirySec seconds. cond can be a redis set condition like NX.

exSet returns a Promise for a boolean, whether the key was set.

 

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @instaffogmbh/verbose-redis

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

6.42 kB

Total Files

5

Last publish

Collaborators

  • bhanu.pv
  • instaffo