json

A collection of handy JSON tools.

API Overview

  • Functions - API calls offered directly by the extension

API Documentation

Functions

​decode​

Signature

cp.json.decode(jsonString) -> table

Type

Function

Description

Decodes JSON into a table

Parameters

​

Returns

​

Notes

​

​encode​

Signature

cp.json.encode(val[, prettyprint]) -> string

Type

Function

Description

Encodes a table as JSON

Parameters

​

Returns

​

Notes

​

​prop​

Signature

cp.json.prop(folder, filename, defaultValue) -> cp.prop

Type

Function

Description

Returns a cp.prop instance for a JSON file.

Parameters

​

Returns

​

​read​

Signature

`cp.json.read(path) -> table

nil` </span>

Type

Function

​

Description

Attempts to read the specified path as a JSON file.

​

Parameters

​

​

Returns

​

​

​write​

Signature

cp.json.write(path, data) -> boolean

Type

Function

Description

Writes data to a JSON file.

Parameters

​

Returns

​