KeyValueStore

The KeyValueStore component allows to store and and retrieve key value pairs on the filesystem.

For example, the KeyValueStore can be helpful to:

  • store and retrieve information between application restarts.
  • share values between different script instances
  • etc.
como.store.set('hello', 'world');
const world = como.store.get('hello');

Methods

(async) clear()

Description:
  • Clear all values from the store

Source:

(async) delete(key)

Description:
  • Delete a key / value pair

Source:
Parameters:
Name Type Description
key String

Key of the key / value pair to delete

(async) get(key) → {Any}

Description:
  • Get a stored value.

Source:
Parameters:
Name Type Description
key String

Key of the value to retrieve

Returns:

The value associated to the key

Type
Any

(async) set(key, value)

Description:
  • Store a key / value pair

Source:
Parameters:
Name Type Description
key String

Key of the value to store

value Any

Value to store