Skip to content

atl/sm/json

import "atl/sm/json"

JSON (sm.json).

func Parse(text string) atl.Value

Parses a JSON string.

func Stringify(v atl.Value, pretty bool) string

Converts a value to JSON.

func Open(path string) atl.Value

Reads a JSON file. Paths use the usual prefixes: "$CONTENT_DATA/...".

func Exists(path string) bool

True if the file exists.

func Save(root atl.Value, path string)

Writes root (a table) as JSON. Only paths the game lets mods write, e.g. "$CONTENT_DATA/...".