A javascript library for interacting with a self-hosted cachier service.
Install package with npm:
npm install cachier-js
Install package with yarn:
yarn add cachier-js
Install package with pnpm:
pnpm add cachier-js
You can even use multiple registries: url: https://www.npmjs.com/package/cachier-js url: https://github.com/apinanyogaratnam/cachier-js/packages/1529765
import Cachier from 'cachier-js';
const client = new Cachier('http://localhost:8000');
const setCache = async (key, value, expiry) => {
const response = await client.set(key, value, expiry);
console.log(response);
}
const getCache = async (key) => {
const response = await client.get(key);
console.log(response);
}
setCache('key', 'value', 1000).then(() => {
getCache('key');
});
Please open an issue for support.
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.