0.2.1 • Published 4 years ago

async-redis-shared v0.2.1

Weekly downloads
30
License
-
Repository
github
Last release
4 years ago

async-redis-shared

A package that wraps redis-async, it adds a shared redis connection to global.ASYNC_REDIS_SHARED, when i have time i will write a singleton class unless i find another 1 that already does this.

Call once as early as possible in your app and await the promise response... then just import it

import the connector and connect

import connect from 'async-redis-shared/connect'
// Initialize Redis connection
connect(config.redis).catch((e) => {
  console.error('Error connecting to redis: ', e);
});

use elsewhere in your app

import client from 'async-redis-shared'
await client.set('key:unittest', String(now));
const fetchedVal = await client.get('key:unittest');
0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago