JSON+ de/serializer in pure lua
This folder defines an LSON spec and an example public domain pure-lua implementation of LSON/JSON encoder and decoder.

Lua Library

lson is a pure-lua JSON+ de/serialization library. The main functions are the encoding functions json() and lson() and the decode() function (which decodes either encoder's output).
See also the types #lson.Json, #lson.Lson and #lson.Decoder and their documentation to have more control of the usage, including pretty printing and a decoding iterator.
Note: If you want highly performant or compliant JSON library then use a different one. This library is part of the civlua project and is optimized for simplicy and improved features.

LSON spec

LSON is a strict superset of JSON: all valid JSON is valid LSON but not vice versa. The difference is:

Mod lson


Types: Json Lson De
Functions

Record Json

Json Encoder (via fmt.Fmt) This works identically to metaty.Fmt except it overrides how tables are formatted to use JSON instead of printing them. Fields: Methods

Record Lson

Similar to JSON but no commas and strings are encoded as |bytes| Fields: Methods

Record De

De(string or lines) -> value-iter for val in De'["my", "lson"' do ... end