Methods
(static) getInstance()
Singleton method. Create and keep only a single object of the storage around.
- Source:
set(key, value) → {Object}
Adding values to data files. Creating the if they are not existent.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Single or multi path segment separated by dots (Examples: 'key', 'key.nested_key', ...) |
value |
* | The value to save under given key |
- Source:
Examples
add("queue.users", 22); // store {"users": 22} inside a file named queue.json
add("queue.1231.servername", "Test Server"); // store {"1231": {"servername": "Test Server"}} inside a file named queue.json
get(key) → {null|*}
Searches for a value under given key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Single/Multi-path segement separated by dots. (Example: 'key', 'key.nested_key', 'users.count', ...) |
- Source: