Node cache manager for Redis, Memcached and DynamoDB
npm install node-multicache-managerA cache module for nodejs that allows easy wrapping of cache operations like read, write and delete. We can configure the underlying engine while creating the adapter classes.
- Easy setup
- Support Memcached, Redis & DynamoDB
- 100% test coverage with functions
```
npm i node-multicache-manager
``
write
read
delete(key: string): Promise
An example in Redis
`javascript
import { CacheManager, CacheEngines } from 'node-multicache-manager';
const RedisConfig = {
port: 6379,
host: '127.0.0.1',
db: 0,
};
const cacheManager = new CacheManager(CacheEngines.redis, RedisConfig);
type Employee = {
name: string,
email: string,
salary: number,
address: string,
};
const writeData: Employee = {
name: 'Adam',
email: 'adam@xxx.com',
salary: 200000,
address: 'Dubai spots city',
};
async function writeExamples() {
const written = await cacheManager.write('hello2', writeData, 120000);
const writtenData = await cacheManager.read
console.log(writtenData);
}
writeExamples();
``