toloframework-permissive-json

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i toloframework-permissive-json

Weekly Downloads

1

Version

1.0.5

License

GPL-3.0

Unpacked Size

58.1 kB

Total Files

9

Last publish

Collaborators

  • tolokoban