JSON Parser & AST (json)
The json module provides zero-import parsing, path-based querying, manipulation, and serialization for structured JSON data across both Native Rust and JavaScript ESM targets.
Functions
json.parse(raw: String) -> ZyraJson
Parses a JSON string into a structured, queryable AST node.
json.get(node: ZyraJson, path: String) -> String
Extracts a field or nested value using dot-notation path traversing.
json.set(node: ZyraJson, path: String, value: String) -> ZyraJson
Inserts or updates a value at the specified key.
json.has(node: ZyraJson, key: String) -> Bool
Checks if a top-level key exists in the JSON object.
json.keys(node: ZyraJson) -> Vec[String]
Returns a list of all top-level keys.
json.stringify(node: ZyraJson) -> String
Serializes a JSON AST node back to a compact JSON string.
json.pretty(node: ZyraJson) -> String
Serializes a JSON AST node with 2-space indentation.