Skip to main content

Module settings

Module settings 

Source
Expand description

Small, atomic JSON settings store.

Settings are user-edited state rather than a database. Updates preserve unknown keys, replace malformed intermediate objects in the same way as the legacy settings layer, and use a same-directory create/sync/rename so an interrupted write cannot leave a half-written config file.

Functionsยง

atomic_write
Write one JSON value via a private same-directory temporary file.
read_object
Read a settings object. Missing files are treated as empty settings.
update
Update a settings object and commit it atomically.