cachu
Simple, minimalistic key-value cache, created by Azury.
- fully asynchronous
- small n' easy
- zero dependencies
Make sure to read our 📃 Changelog
Setup
Install the Package
Install cachu using your favorite package manager.
npm i cachu
yarn add cachu
Usage
Just create a new instance, it's as easy as that!
import { MemoryCache } from 'cachu'
const cache = new MemoryCache({
maxAmount: 420,
maxAge: 60
})
(async () => {
await cache.write(69, 'Hello World')
console.log(await cache.get(69))
})()
Caches
API
-
Configuration
maxAge
to set the maximum age for each record in the cachemaxAmount
to set the maximum size for the cacheoverrideEntries
to allow overriding of entries on readinghooks
to extend cachu's functionality
-
Features