@cacher/redis

Implementation of the redis adapter

Usage no npm install needed!

<script type="module">
  import cacherRedis from 'https://cdn.skypack.dev/@cacher/redis';
</script>

README

NPM version NPM downloads

Implementation of the redis adapter

Installation

Node.js 14.0.0 or newer is required

Yarn

yarn add @cacher/redis

NPM

npm i @cacher/redis

Example usage

import { Cacher } from '@cacher/cacher';
import { RedisAdapter } from '@cacher/redis';

const adapter = new RedisAdapter();

// const adapter = new RedisAdapter({
// 	connection: ioredisClient	
// });

// const adapter = new RedisAdapter({
// 	connection: 'redis://:authpassword@127.0.0.1:6380/4'
// });

// const adapter = new RedisAdapter({
// 	connection: {
// 		hostname: 'localhost',
// 		port: 6379,

// 		username: '...',
// 		password: '...',

// 		database: 1
// 	}
// });

const cacher = new Cacher({
    adapter,

    namespace: 'users'
});