I am trying to load and parse a 1GB .JSON in some JavaScript to be run locally in a user's browser.
It is too big for FileReader.readAsText()
.
I am able to read it in with FileReader.readAsArrayBuffer()
but then have to chunk it to convert from a Uint8 array to an array of chunked strings which is then too long to .join()
for parsing.
At the moment the only solution I can see is to chunk the strings into separate JSON objects, parse them individually and then merge the parsed objects.
I'm new to JavaScript so suspect I am going about this an inefficient and unconventional way. Do you know of a better way to locally read and parse such a large .JSON file in JavaScript in a browser?