klyn.io.json.JSON.stringify
method
public static stringify(target as Object, object as Object = null, spaces as Boolean = true, pretty as Boolean = false, indent as Int = 0) as String throws IOException:
DescriptionSerializes a value as JSON.
- `JSON.stringify(value)`
- `JSON.stringify(value, spaces=false)`
- `JSON.stringify(value, pretty=true)`
- `JSON.stringify(value, pretty=true, indent=2)`
- `JSON.stringify(writerOrPathOrFile, value)`
`Path`) when `object` is provided.
falls back to 4 spaces.
config = {"fullscreen": true, "theme": "dark"}
print(JSON.stringify(config, pretty=true, indent=2))