@statter/redis
v1.0.2
Published
statter redis
Downloads
11
Readme
@statter/redis
Redis cache layer for NestJS on top of keyv and @keyv/redis.
What Is Included
RedisModule(global module).RedisServicemethods:get,set,del,clearwrap,hasgetMany,setMany,deleteMany
Example
import { RedisModule, RedisService } from "@statter/redis"
@Module({
imports: [RedisModule]
})
export class AppModule {}
@Injectable()
export class ExampleService {
constructor(private readonly redis: RedisService) {}
async getCachedValue() {
return this.redis.wrap("example:key", async () => "value", 60_000)
}
}Build
npm run build -w @statter/redis