@cacher/redis
v0.2.0
Published
Implementation of the redis adapter
Downloads
9
Readme
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://:[email protected]:6380/4'
// });
// const adapter = new RedisAdapter({
// connection: {
// hostname: 'localhost',
// port: 6379,
// username: '...',
// password: '...',
// database: 1
// }
// });
const cacher = new Cacher({
adapter,
namespace: 'users'
});