Module basic module

Module json

json encoding and decoding module

Reference method:

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, variable to be encoded

Return result:

  • String , returns the encoded string

decode

Decode the string into a variable in json way

1
static Value json.decode(String data);

Call parameters:

  • data : String, the string to be decoded

Return result:

  • Value , returns the decoded variable