toloframework-permissive-json
v1.0.5
Published
Permissive JSON parser. Accept comments, missing quotes and commas, unspecified attributes names in objects.
Downloads
11
Maintainers
Readme
toloframework-permissive-json
Permissive JSON parser. Accept comments, missing quotes and commas, unspecified attributes names in objects.
Usage
var PermissiveJSON = require("./toloframework-permissive-json");
var obj = PermissiveJSON.parse( "[A{B}]" );
Example
Permissive JSON:
{ul
// This comment will be ignored.
class: [bright, shadowed]
[
{li ["Happy birthday!"]}
{li ["Mister president."]}
]
}
The same object in stric JSON:
{
"0": "ul",
"class": ["bright", "shadowed"],
"1": [
{ "0": "li", "1": ["Happy birthday!"] },
{ "0": "li", "1": ["Mister president."] }
]
}