1.0.5 • Published 6 years ago

toloframework-permissive-json v1.0.5

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
6 years ago

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."] }
  ]
}