Module basic module

module json

json encoding and decoding module

Quote:

1 2
var encoding = require('encoding'); var json = encoding.json;

or

1
var json = require('json');

static function

encode

Encode variables in json format

1
static String json.encode(Value data);

Call parameters:

  • data: Value, the variable to encode

Return results:

  • String, returns the encoded string

decode

Decode a string into a variable in json mode

1
static Value json.decode(String data);

Call parameters:

  • data: String, the string to be decoded

Return results:

  • Value, returns the decoded variable