Skip to content

Switches

W. "Mac" McMeans edited this page Jun 3, 2022 · 12 revisions

The following optional switches may be used when instantiating localDataStorage:

/q - quiet mode

/w - warning mode

/t - interface test

Quiet mode will not output anything to the console when localDataStorage starts up. This mode is handy when you don't need to see warnings (or any other output).

In warning mode, the software will first check if the specified prefix has already been used with keys that exist in localStorage, and if so, a warning message is sent to the console. This mode is useful when you need to see warnings on startup, to prevent existing keys from being potentially overwritten.

When no switches are used, standard output will be sent to the console, but warnings will not appear even if they exist. When multiple switches are specified, quiet mode will be overridden.

EXAMPLES:

Show standard output, ignoring any warnings

  • z = localDataStorage( 'mac' ); -->
    localDataStorage instantiated. The specified prefix (mac.) adds 4 bytes to every key name (stored using 8 bytes).

Show standard output, along with any warnings (in this case the prefix has already been used)

  • z = localDataStorage( 'mac', '/w' ); -->
    localDataStorage instantiated. The specified prefix (mac.) adds 4 bytes to every key name (stored using 8 bytes).
    Attention! Keys with this prefix already exist in localStorage for this domain!

Show no output whatsoever

  • z = localDataStorage( 'mac', '/q' ); -->

Using multiple switches

  • z = localDataStorage( 'my-app-storage', '/q/w/t' ); -->
    Tested good: The localStorage API is available

When starting localDataStorage, you may specify the data store key prefix.

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