Represents a memory database where the data is housed in a single json file.

Implements

Constructors

Methods

Constructors

Methods

  • Gets the value of a specific key in the database.

    Type Parameters

    • T

    Parameters

    • key: string

      The key to retrieve.

    Returns Promise<null | T>

    The value of the given key, null if no such value exists and no fallback was provided.

  • Gets the value of a specific key in the database.

    Type Parameters

    • T

    Parameters

    • key: string

      The key to retrieve.

    • fallback: T

      The fallback value. If the key does not exist in the database, then this will be inserted automatically.

    Returns Promise<T>

    The value of the given key or the inserted fallback value if the key does not exist.