Factry Historian
...
Standard Library
json
module "json" tengo json = import("json") functions decode(b string/bytes) => object parses the json string and returns an object encode(o object) => bytes returns the json string (bytes) of the object unlike go's json package, this function does not html escape texts, but, one can use html escape function if needed indent(b string/bytes) => bytes returns an indented form of input json bytes string html escape(b string/bytes) => bytes return an html safe form of input json bytes string examples tengo json = import("json") encoded = json encode({a 1, b \[2, 3, 4]}) // json encoded bytes string indentded = json indent(encoded) // indented form html safe = json html escape(encoded) // html escaped form decoded = json decode(encoded) // {a 1, b \[2, 3, 4]}