JSON Store

API to read and write objects to the YAKjs key/value store. The store is also accessible via the web interface. A key can be namespaced with '.', use only for a better visualization on the web interface.

Usage

const store = require('./common/jsonStore');

setValue(key, value)

Creates or updates a store item.

ParameterTypeDescription
key

string

The unique key for the item.

value

Object

The item value. Any JSON serializable object.

let contacts= [{name: 'Hugo', email: 'hugo@example.com'}];
store.setValue('myPlugin.data.key', contacts);

getValue(key)

Gets a store item.

ParameterTypeDescription
key

string

The store item key.

var data = store.getValue('myPlugin.data.key');