smelt.json¶
Tier: Host - Available in every runtime, including headless mode.
Classification: Supported - Primary alpha facade for user config and plugins.
Encode/decode JSON for Lua plugins. Tables with contiguous 1..N integer keys encode as arrays; other tables encode as objects. Use smelt.json.array() when an empty table must encode as an array.
smelt.json.array¶
Create an empty JSON array table. Unlike {}, it encodes as [] while empty.
smelt.json.decode¶
Decode JSON into a Lua value. Returns (value, nil) on success or (nil, err_string) on failure.
smelt.json.encode¶
Encode a Lua value as JSON. Pass { pretty = true } to format with indentation. Tables with contiguous 1..N integer keys encode as arrays; other tables encode as objects. Use smelt.json.array() for an empty array.