Kfg Documentation
    Preparing search index...

    Class JsonDriver

    Hierarchy (View Summary)

    • KfgDriver<{ keyroot?: boolean; path?: string }, false>
      • JsonDriver
    Index

    Constructors

    Properties

    async: false
    config: { keyroot?: boolean; path?: string }
    forceExit: boolean
    name: string

    Methods

    • Optional hook for deletion. Use this ONLY if the driver handles atomic deletion. If implemented, Kfg.del() will call this INSTEAD of save().

      Parameters

      • key: string

        The key deleted.

      Returns void

    • Optional hook to format validation errors.

      Parameters

      • errors: any[]

        The array of errors from TypeBox/Value.

      Returns string

      A formatted string or undefined to use default formatting.

    • Saves the configuration to the source.

      Parameters

      • data: Record<string, any>

        The full configuration object.

      • Optionaloptions: { description?: string; path?: string }

        Optional metadata for the save operation (e.g. description for a specific update).

      Returns void

    • Optional hook for updates. Use this ONLY if the driver handles atomic updates and doesn't need the full object every time. If implemented, Kfg.set() will call this INSTEAD of save().

      Parameters

      • key: string

        The key updated (dot notation).

      • value: any

        The new value.

      • Optionaldescription: string

      Returns void