PowerJSON
Powerjson 是由 JSON 改进而成的数据交换格式,它将 JSON 支持了部分 JavaScript 语法,使其更加高效可用,并且解决了许多 JSON 历史遗留下来的问题。 
它支持 单引号字符串, 多行字符串, 注释, 运算符, 导入文件, 导入其它 PJSON 文件 等。
Simple Demo
{
helloText: 'hello world',
MultiLineText: `
Welcome
to
PowerJSON!
`,
myFile: new File('./file.txt'),
importPJSONFile: new PJSON('./index2.pjson'),
getFile: new GET('http://www.powerjson.org'),
tenDaySeconds: 60 * 60 * 24 * 10
}
兼容性
PowerJSON 支持所有兼容 ES6 的 浏览器 / js 运行时。
浏览器:
- IE >= 11
- Edge All
- Firefox >= 6
- Chrome >= 21
- Safari >= 7.1
- Opera >= 15
Node.js:
|