1.0.0 • Published 5 years ago

poom-redis v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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
    }
}
1.0.0

5 years ago

0.0.1

6 years ago