If it's too big for memory, the best approach would be to just search for the tokens that you want. You'd probably want to check both the current and last bit of data together, in case the information you want spans multiple ones:
var last = "";
res.on('data',function(data) {
var s = last+data;
if (s.indexOf(...)) ...;
last = data;
});
Potentially if you just want some of the data, you could bracket-count until you get to the right part?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It stops with an error?
If it's too big for memory, the best approach would be to just search for the tokens that you want. You'd probably want to check both the current and last bit of data together, in case the information you want spans multiple ones:
Potentially if you just want some of the data, you could bracket-count until you get to the right part?