Class: Database

Database()

Database is a simple persistence utility that saves stored data to a json file.

Constructor

new Database()

Create a db object.
Source:

Members

(static) DATA_FILE

The file the data is stored to.
Source:

Methods

get(key) → {*}

Returns a value from the db.
Parameters:
Name Type Description
key String The key for the desired value
Source:
Returns:
The value that was stored on the key
Type
*

load()

Replaces the current state of the db with the contents from the DATA_FILE.
Source:

save()

Saves the current state of the db to the DATA_FILE.
Source:

set(key, value)

Sets a value for a key in the db.
Parameters:
Name Type Description
key String The key to store to
value * The value to store
Source: