Uses a JSON file to store key/value pairs.

Hierarchy

  • JsonFileStorage

Implements

Constructors

Properties

filePath: string
lockIdentifier: ResourceIdentifier

Methods

  • Updates the data in the JSON file while using a write lock.

    Type Parameters

    • T

    Parameters

    • updateFn: ((json) => T)

      A function that updates the JSON object.

        • (json): T
        • Parameters

          • json: Dict<unknown>

          Returns T

    Returns Promise<T>

    The return value of updateFn.