Parse complete javascript objects from partial JSON strings. I looked around a bit for something that could parse chunked data from a fetch request, but could not find an implementation that was either minimal or written in javascript. Tested this against some random nested data generated by www.json-generator.com, but there could still be issues if any string values contain escape characters.
Incomplete JSON strings will be parsed to its nearest complete object.
Input:
{ name: { first: 'ind', last: 'go
Output:
{ name: { first: 'ind' } }
From the CLI:
npm install --save partial-json-parser
From javascript:
var partialParse = require('partial-json-parser');
var output = partialParse('"key": "value"');
Alternatively, you can directly use the script in the browser with a script tag.