Skip to content
W. "Mac" McMeans edited this page May 2, 2022 · 80 revisions

As an interface for the HTML5 localStorage API, localDataStorage 1) lets you set and get keys while respecting native data types, 2) provides simple data scrambling, 3) intelligently compresses string data, 4) permits query by key (name) as well as query by (key) value, and 5) facilitates shared storage segmentation in the same domain.

Because JavaScript is running in a single thread in the browser, there are no race conditions or concerns with atomicity using localDataStorage. Further, all methods are synchronous. (Obviously, this is not referring to node.js, where single-threaded JavaScript is running on a server; or web workers, where multiple processes are running in a single thread.)

Both the keyname and its value are case-sensitive. The localDataStorage wrapper can be considered a superset of web storage, and it fires its own change events.

Data created under this software is considered to be generally incompatible with the HTML5 localStorage API. While keys can still be read (using getItem), since localDataStorage handles so much more than just strings, the default string values returned by localStorage won't make much sense.

When you're ready to include this in your next project, it's easy to get started.

 

The usual suspects:

clear                 key                 remove                 set / get

 

The esoteric ones:

Bypass:
forceset / forceget

General query:
haskey, hastype, hasval

Security:
safeset / safeget

setscramblekey / getscramblekey

Utility:
chopget

rename

softset

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