@ordermentum/cache-machine

simple cache built on redis

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
012Jun 13, 2021Jan 22, 2018Minified + gzip package size for @ordermentum/cache-machine in KB

Readme

cache-machine

simple cache built on redis

usage

const cache = require('cache-machine')(redis);
await cache.set('my-key', { test: true });
await cache.get('my-key');
await cache.getAndDel('my-key');
const limited = await cache.rateLimit('my-key', 1, 60);
if (limited) console.log('oh no');

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.