public static stringify(path as Path, value as Object, spaces as Boolean = true, pretty as Boolean = false, indent as Int = 0) as String throws JSONWriteException, IOException:
Serializes a value and writes it to a path.
| Parameter | Description |
|---|---|
path | Destination path. |
value | Value to serialize, including null. |
spaces | When pretty is false, controls compact spacing. |
pretty | Enables multi-line formatting. |
indent | Indentation width when pretty is true. |
The JSON text written to the path.
path = FilePath("settings.json")
JSON.stringify(path, null)