@sudtanj/memoize-redis-decorator

1.0.2 • Public • Published

memoize-redis-decorator

Memoize decorator, backed by Redis

Example

import {MemoizeRedis} from 'memoize-redis-decorator'

const memoizeRedis = new MemoizeRedis({
  ttl: 600 // Time to live, default 600 seconds
  redisOptions: {} // Options, which directly passed to ioredis. By default, connected to locahost:6379
})

class MyClass {
  @memoizeRedis.memoize()
  async needCache(args) {
    // Some heavy stuff...
  }
}

Package Sidebar

Install

npm i @sudtanj/memoize-redis-decorator

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

10.6 kB

Total Files

9

Last publish

Collaborators

  • sudtanj