Skip to content

imnull/jsonx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

MarvinMarvin
Marvin
and
Marvin
Apr 7, 2019
0d14d9c · Apr 7, 2019

History

8 Commits
Apr 7, 2019
Apr 7, 2019
Apr 7, 2019
Apr 7, 2019
Apr 7, 2019
Apr 7, 2019
Apr 7, 2019
Apr 7, 2019
Apr 7, 2019

Repository files navigation

JSONX

200行的泛JSON(P)解析器。

安装

npm i json-generic

NPM: https://www.npmjs.com/package/json-generic

更新

1.2.0

  • 使用webpack压缩

1.1.1

  • 完善文档

1.1.0

  • 模块化适配,支持 Common-ModuleAMDBrowser
  • Quote Nest 解析失败错误处理和定位
  • 方法名称优化
  • 增加HTML测试文件test.html

特性

  • 可识别JSONJSONPJavaScript等数据格式
  • 单双引号均可使用
  • 破损文档的错误定位

使用

const jsonx = require('json-generic');

console.log(jsonx.parse(`null`));
console.log(jsonx.parse(`1e3`));
console.log(jsonx.parse(`'1e3'`));
console.log(jsonx.parse(`"String"`));
console.log(jsonx.parse(`[1,2,3,{a:1}]`));

About

泛JSON(P)解析器

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published