λJSON- JSON 替代
JavaScript JSON/BSON开发包
访问GitHub主页
共0Star
详细介绍
λJSON 是 JSON 的嵌入式替代品,它可以让你解析和字符串化纯函数及其内容。
示例代码:
var LJSON = require("LJSON");// `newPlayer` is a function and couldn't be serialized with JSON.function newPlayer(name){ return {
name : name,
hp : 12,
atk : 5,
def : 5,
inventory : []}
};
// LJSON has no trouble doing it because `newPlayer` is pure.
var newPlayerSource = LJSON.stringify(newPlayer);
var John = LJSON.parse(newPlayerSource)("John");console.log("Serialized λJSON: " + newPlayerSource);console.log("Parsed and applied: " + John);
推荐源码
暂无源码 更多源码...