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. The lock is held across the whole cycle, so concurrent writers queue instead of losing each other's updates — and waiting for it yields rather than blocking.
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 without blocking the event loop.
Same file format and same safeguards as
JsonDriver— they share every bit of parsing, serialization and error formatting — but all I/O is promise-based, including waiting for the write lock. In a server, asetthat has to queue behind another writer no longer stalls everything else.Because the driver is async,
Kfg's methods return promises:lazyandKfg.poolare not available here: both materialize state on first access, which cannot be done behind a synchronousget().