Module json
json encoding and decoding module
Reference method:
1
2var encoding = require('encoding');
var json = encoding.json;
or
1var json = require('json');
Static function
encode
Encode variables in json format
1static String json.encode(Value data);
Call parameters:
- data: Value, the variable to be encoded
Return result:
- String, Return the encoded string
decode
Decode the string as a variable in json way
1static Value json.decode(String data);
Call parameters:
- data: String, the string to be decoded
Return result:
- Value, Return the decoded variable