json 编码与解码模块 引用方式:
var encoding = require('encoding');
var json = encoding.json;
或者
var json = require('json');
| Type | Method and Description |
|---|---|
| String | encode(Value data)以 json 格式编码变量 |
| Value | decode(String data)以 json 方式解码字符串为一个变量 |
encode(Value data)以 json 格式编码变量
data 要编码的变量返回编码的字符串
decode(String data)以 json 方式解码字符串为一个变量
data 要解码的字符串返回解码的变量