json

This module provides built-in JSON serialization/deserialization support.

Functions

parse(jsonString)

Deserializes a given JSON from a string

ArgumentDescription
jsonStringA string representing a valid JSON

Returns: The deserialized JSON or null if parsing failed.

parseFile(jsonPath)

Reads and parses the provided JSON file.

ArgumentDescription
jsonPathA valid path to a readable file

Returns: The deserialized JSON or null if parsing failed.

stringify(value, prettify)

Serializes a given value to a JSON string.

ArgumentDescription
valueThe value that should be JSON serialized
prettifytrue If the output should be prettified, defaults to false

Returns: A JSON string representing value or null if serialization failed.