Standard Library

std.json

JSON encoding and decoding utilities.

Exported functions

pub def encode[T](value: T) -> String

Encode any Tea value to a JSON string.

pub def decode[T](json_str: String) -> T

Decode a JSON string to a Tea value.

pub def read_file[T](file_path: String) -> T

Read a JSON file and decode it.

pub def write_file[T](file_path: String, value: T) -> Void

Encode a value as JSON and write it to a file.