@gibme/cache
v1.1.10
Published
A caching helper wrapped around various cache types
Downloads
378
Readme
A Simple Caching Wrapper
Features
- Provides a common interface between backend systems
- Backend systems supported:
Documentation
https://gibme-npm.github.io/cache
Sample Code
Memory
import Memory from '@gibme/cache/memory';
(async () => {
const client = new Memory();
await client.set('somekey', { some: 'value' });
const value = await client.get('somekey');
if (value) {
console.log(value);
}
await client.disconnect();
})();
Redis
import Redis from '@gibme/cache/redis';
(async () => {
const client = new Redis({
host: 'localhost',
username: 'someuser',
password: 'somepassword'
});
await client.set('somekey', { some: 'value' });
const value = await client.get('somekey');
if (value) {
console.log(value);
}
await client.disconnect();
})();