laxson
v1.0.1
Published
Laxson: lax JSON ================
Downloads
183
Readme
Laxson: lax JSON
Sometimes it is useful to parse non-compliant JSON for whatever reason:
- single quoted strings
- 0x00 hexadecimal numbers
- trailing commas
- comments
- missing delimiters/quotes/typos
- non-quoted property names
Laxson uses TypeScript fault-tolerant parser, and processes generated AST back to objects.
Parsing uses no unsafe eval
and such, so even though it's lax, it's still safe.
Except data might be a bit garbage, if input is too garbled.
var LAXSON = require('laxson');
console.log(JSON.stringify(LAXSON.parse('{ apple: [1, 0x2, 3_000] }')));