public static stringify(filename as String, 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 file named by a string.
| Parameter | Description |
|---|---|
filename | Destination filename. |
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 file.
JSON.stringify("settings.json", {"theme": "dark"})