Provides the ability to manage a key / value pair within the targeted
runtime environment. The storage methods of "local" and "session" are
supported on both Deno and Web Browsers. "cookie" method is only supported
on Web Browser and will result in a SyntaxError if called in a Deno
runtime.
- Source:
- See:
-
Methods
(static) clear(params) → {void}
Clears the specified storage method.
Parameters:
Name |
Type |
Description |
params |
object
|
The named parameters.
Properties
Name |
Type |
Attributes |
Default |
Description |
method |
string
|
<optional>
|
"local"
|
Values of cookie, local, or
session. |
|
- Source:
Returns:
-
Type
-
void
(static) getItem(params) → (nullable) {string}
Gets data from the identified method via the specified key.
Parameters:
Name |
Type |
Description |
params |
object
|
The named parameters.
Properties
Name |
Type |
Attributes |
Default |
Description |
method |
string
|
<optional>
|
"local"
|
Values of cookie, local, or
session. |
key |
string
|
|
|
The key field to retrieve. |
|
- Source:
Returns:
The associated with the key or null if not found.
-
Type
-
string
(static) key(params) → (nullable) {String}
Gets the key from the index from the identified storage method.
Parameters:
Name |
Type |
Description |
params |
object
|
The named parameters.
Properties
Name |
Type |
Attributes |
Default |
Description |
method |
string
|
<optional>
|
"local"
|
Values of cookie, local, or
session. |
index |
number
|
|
|
The index of where the key exists in
storage. |
|
- Source:
Returns:
The name of the key or null if the index goes
beyond the stored length.
-
Type
-
String
(static) length(params) → {number}
Total items stored in the identified method.
Parameters:
Name |
Type |
Description |
params |
object
|
The named parameters.
Properties
Name |
Type |
Attributes |
Default |
Description |
method |
string
|
<optional>
|
"local"
|
Values of cookie, local, or
session. |
|
- Source:
Returns:
The number of key / value pairs stored within the
storage method.
-
Type
-
number
(static) removeItem(params) → {void}
Removes an item by key from the identified storage method.
Parameters:
Name |
Type |
Description |
params |
object
|
The named parameters.
Properties
Name |
Type |
Attributes |
Default |
Description |
method |
string
|
<optional>
|
"local"
|
Values of cookie, local, or
session. |
key |
string
|
|
|
The key field to remove. |
|
- Source:
Returns:
-
Type
-
void
(static) setItem(params) → {void}
Sets a value by the identified key within the identified storage
method.
Parameters:
Name |
Type |
Description |
params |
object
|
The named parameters.
Properties
Name |
Type |
Attributes |
Default |
Description |
method |
string
|
<optional>
|
"local"
|
Values of cookie, local, or
session. |
key |
string
|
|
|
The identified key to associate with
the value. |
value |
string
|
|
|
The value to set. |
|
- Source:
Returns:
-
Type
-
void