webext-ttl-cache
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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.

Package Sidebar

Install

npm i webext-ttl-cache

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

9.24 kB

Total Files

5

Last publish

Collaborators

  • banyudu