README
poom-redis
A plugin helps to manage redis for poom
Install
npm i poom-redis -S
Examples
Typescript
Config redis information
import { Redis } from 'poom-redis';
Redis({
host: 'localhost'
})
Redis({
key: 'connection1',
host: 'localhost'
})
Use in service file
import { Redis, REDIS } from 'poom-redis';
export class ChartService {
@REDIS()
static redis: Redis;
@REDIS('connection1')
static redis1: Redis;
static async sendToRabbitmq(data: any = {}) {
ChartService.redis.set('key', data, 60); // stored data and expired time is 60 secs
}
}