cachu
![snyk vulnerabilities](https://snyk.io/test/github/azurystudios/cachu/badge.svg)
Simple, minimalistic key-value cache, created by Azury.
Compatible with Node.js v16 and v17 only!
Why should you use cachu?
- fully asynchronous
- small n' easy
- zero dependencies
Upcoming features are listed over here.
Known Issues
Currently there are no known issues.
Installation
Install the Package
Install it using your favorite package manager.
npm i cachu
yarn add cachu
pnpm add cachu
Create New Instance
Just create a new instance, it's as easy as that!
import { Cachu } from 'cachu'
const cache = new Cachu({
maxAmount: 10,
maxAge: 60
})
const demo = async () => {
await cache.set(123, 'hello world')
console.log(await cache.get(123))
}
demo()
API
Configuration
maxAge
to set the maximum age for each item in the storemaxAmount
to set the maximum size for the store
Features