JSON parsing module for Quadrate.
quadpm install jsonuse json
fn main() {
'{"name": "Alice", "age": 30}' -> data
data "name" json::get_string -> name
data "age" json::get_int -> age
name print nl
age print nl
}
get_string(json:str key:str -- value:str found:bool)- Get string value by keyget_int(json:str key:str -- value:int found:bool)- Get integer value by keyget_bool(json:str key:str -- value:bool found:bool)- Get boolean value by keyhas_key(json:str key:str -- found:bool)- Check if key existsget_type(json:str key:str -- type:str)- Get type of value ("string", "number", "bool", "array", "object", "null")array_len(json:str -- len:int)- Get length of JSON arrayarray_get(json:str index:int -- value:str)- Get array element by index
MIT