open-index/open-npm huggingface dataset:
npm package: @statter/redis
Description: statter redis
Author: Statter 🚀
Latest version: 1.0.2

# @statter/redis

Redis cache layer for NestJS on top of `keyv` and `@keyv/redis`.

## What Is Included

- `RedisModule` (global module).
- `RedisService` methods:
- `get`, `set`, `del`, `clear`
- `wrap`, `has`
- `getMany`, `setMany`, `deleteMany`

## Example

```ts
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

```bash
npm run build -w @statter/redis
```