0.1.4 • Published 4 years ago

vanillite v0.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

vanillite

What is it?

Vanillite is a wrapper around localforage. It seeks to leave the main-used functionality unused. It, unlike localforage, wants to move lightning-fast.

the default cache option allows for storing 1000 items in memory at a time, always the latest things stored. It also makes writes drop out of time, so you don't have to wait to get your item back. This improves performance alot. Against a stubbed lib that is even faster than localforage, it was beating it by about 2->4 orders of magnitude. most "writes" happened in less than 0.5ms.

How to use it?

import it and use it, just like localforage!

  import Vanillite from 'vanillite';

  const fastStore = new Vanillite({ name: 'cards' });

  const item = await fastStore.setItem(nanoId(), { some: 'stuff' });

  const allItemIds = await fastStore.keys();

TODO:

Low priority

  1. write more readme on how to set cache settings
  2. add weirdness of instantiation to 100% mirror localforage
  3. test all remaining methods to validate it is compatible with a bare localforage installation
  4. investigate different cache constructions than last in
0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.0

4 years ago