0.1.3 • Published 5 years ago

@instaffogmbh/verbose-redis v0.1.3

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
5 years ago

@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

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago