-
-
Notifications
You must be signed in to change notification settings - Fork 15
Getting Started
The code is contained in one JavaScript file, which creates a single constructor function called localDataStorage in the global scope.
To use localDataStorage--
- bring the code into your page (via <script> tags, direct copy, etc.)
- instantiate it with a meaningful prefix
The generic call would look something like localDataStorage( prefix, switch );
For example:
<script src="localDataStorage-1.3.0.min.js"></script>
<script>
var localData = localDataStorage( 'passphrase.life' );
</script>
At this point all key names will have the prefix passphrase.life. prepended to them (note the trailing period), so calling set( 'authorName', 'Mac' ) will store the authorName key as passphrase.life.authorName internally.
To control how localDataStorage starts up, you may use a few switches. You may also specify the storage key prefix.
Array Keys:
push / pull, pullall poke contains where
Broadcasting:
broadcast
Data Transfer:
import / export
Duplicates:
countdupes, showdupes, listdupes
Internals:
cancrunch crunch / uncrunch
shufflestring / unshufflestring
Management:
keys
Memory Consumption:
Memory Quota:
showquota
Query:
haskey, hasval, hastype
setscramblekey / getscramblekey
Type Check:
isarray isbigint isboolean iscrunch
isdate isfloat isinteger isnull
Utility:
chopget copy softset rename
_set / _get _clear _key _remove
Management:
_keys
Type Check:
_isarray _isbigint _isboolean _iscrunch