0.1.3 • Published 6 years ago
@instaffogmbh/verbose-redis v0.1.3
@instaffogmbh/verbose-redis
ioredis + logging
- 📣 💼 💰 Looking for a tech job? Try our reverse recruiting service.
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