0.0.1 • Published 5 months ago
webext-ttl-cache v0.0.1
webext-ttl-cache
TTL cache for web extensions.
Usage
import { get, set, del, clear, keys, has } from 'webext-ttl-cache';
async function demo () {
await set('foo', 'bar', 1000); // 1000ms TTL
const value = await get('foo'); // 'bar'
await has('foo'); // true
const myKeys = await keys(); // ['foo']
await del('foo'); // delete 'foo'
await clear(); // delete all keys
}
Caution
This is an early stage project. Use at your own risk.
0.0.1
5 months ago