https://github.com/darky/memoize-redis-decorator
Memoize decorator, backed by Redis
https://github.com/darky/memoize-redis-decorator
cache decorator memoize redis
Last synced: 28 days ago
JSON representation
Memoize decorator, backed by Redis
- Host: GitHub
- URL: https://github.com/darky/memoize-redis-decorator
- Owner: darky
- Created: 2018-08-02T20:29:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T20:39:13.000Z (almost 8 years ago)
- Last Synced: 2025-07-06T05:41:12.133Z (11 months ago)
- Topics: cache, decorator, memoize, redis
- Language: TypeScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# memoize-redis-decorator
Memoize decorator, backed by Redis
## Example
```typescript
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...
}
}
```