1.1.21 • Published 7 years ago

vnng-cache-repo v1.1.21

Weekly downloads
2
License
ISC
Repository
-
Last release
7 years ago

VNNG Repository

Cache Repository for Swap-Ez's services

Installation

npm install vnng-cache-repo --save

or

yarn add cache-repo

Usage

const cacheRepo = require('vnng-cache-repo');

const cacheStoreSettings = () => ({
    host: process.env.REDIS_HOST || 'localhost',
    port: process.env.REDIS_PORT || 'port',
    password: process.env.REDIS_PWD || 'password'
});
const connect = (cacheStoreSettings) => new Promise(function (resolve, reject) {
    const redisClient = new redis.createClient(cacheStoreSettings());
    redisClient.on('ready', () => {
        debug('ready');
        resolve(redisClient);
    });

    redisClient.on('error', (err) => {
        debug('error');
        reject(err);
    });
});

connect(cacheStoreSettings).then((redisClient) => {
    const container = createContainer();
    container.register(CACHE_STORE, asValue(redisClient));
    return cacheRepo.connect(container);
}).then((container) => {
    const { checkExistsAnonymous } = container.cradle.cacheRepo;
});
1.1.21

7 years ago

1.1.20

7 years ago

1.1.19

7 years ago

1.1.18

7 years ago

1.1.17

7 years ago

1.1.16

7 years ago

1.1.15

7 years ago

1.1.14

8 years ago

1.1.13

8 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago