Skip to content

Memory Keys

W. "Mac" McMeans edited this page Aug 12, 2022 · 22 revisions

As the name suggests, key data is stored in volatile memory. There is no storage overhead and performance is orders of magnitude faster, at the slight risk of data loss.

Keys are set as properties of the object you created when you instantiated localDataStorage. For example, this code

const myStorage = localDataStorage( 'hackerNewsVue' ); 

would cause all Memory Keys to be stored as properties of the myStorage object, and as long as the object is intact so are the key value pairs.

In most cases, using Memory Keys is identical to using disk-based localStorage keys. For example, get and _get (Memory Key method) are practically the same.

✨ To mitigate the risk of data loss, consider using the backup and restore methods.

📝 NOTE: Memory Keys do not trigger storage change events.

localStorage Keys

The usual suspects:

set / get      clear      key      remove

The esoteric ones:

Array Keys:
push / pull, pullall      poke      contains      where

Broadcasting:
broadcast

Bypass:
forceset / forceget

Data Transfer:
import / export

Duplicates:
countdupes, showdupes, listdupes

Internals:
cancrunch      crunch / uncrunch

shufflestring / unshufflestring

xorstring

Management:
keys

Memory Consumption:

Memory Quota:
showquota

Query:
haskey, hasval, hastype

Security:
safeset / safeget

setscramblekey / getscramblekey

Type Check:
isarray      isbigint      isboolean      iscrunch

isdate      isfloat      isinteger      isnull

isnumber      isobject      isstring

showtype

Utility:
chopget      copy      softset      rename

Properties:

channel      length      quota      version

Settings:

verbosity

Memory Keys

Standard:

_set / _get      _clear      _key      _remove

Unconventional:

Data Sync:
_backup / _restore

Management:
_keys

Security:
_safeset / _safeget

Type Check:
_isarray      _isbigint      _isboolean      _iscrunch

_isdate      _isfloat      _isinteger      _isnull

_isnumber      _isobject      _isstring

_showtype

Utility:
_chopget      _copy      _softset      _rename

Clone this wiki locally