ReadonlyasyncProtectedcommentsReadonlyforceReadonlynameProtectedbuildProtectedcolorizeOptionaldeleteOptional hook for deletion. Use this ONLY if the driver handles atomic deletion. If implemented, Kfg.del() will call this INSTEAD of save().
The key deleted.
ProtectedflattenOptional hook to format validation errors.
The array of errors from TypeBox/Value.
A formatted string or undefined to use default formatting.
ProtectedgetProtectedinjectProtectedjsonOptionaljsonPath: stringProtectedjsonProtectedjsonLoads the configuration from the source.
The schema definition.
The loaded configuration object.
ProtectedmergeProtectedparseParses raw file content into a config object (comments/keyroot/defaults).
ProtectedparseParses content read inside a transaction, tolerating a corrupted file.
Saves the configuration to the source.
The full configuration object.
Optionaloptions: { description?: string; path?: string }
Optional metadata for the save operation (e.g. description for a specific update).
ProtectedserializeProtectedstripLocked read-modify-write: reads the current persisted config, passes it
to fn, and atomically writes the result — all under one lock, so
concurrent processes cannot lose updates.
OptionalupdateOptional 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().
The key updated (dot notation).
The new value.
Optionaldescription: stringProtectedwrapProtectedwrite
Persists the configuration to a JSON file, synchronously.
Every write goes through the safeguard layer: lock file, temp-write + verification + atomic rename, and a backup mirror used to recover a corrupted main file on load. See
JsonAsyncDriverfor the non-blocking counterpart.