However this may be counterproductive. require("Storage").read effectively 'memory maps' the JSON that's in flash memory, so it doesn't actually use up any RAM when it's sitting there as a string.
It's only when you decode it with JSON.parse that it ends up using a bunch of memory
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.
I'm afraid you can't, since heatshrink compresses only a sequence of bytes, not a structure.
If you want to compress it and get the data back, you'll need to compress the JSON, so:
However this may be counterproductive.
require("Storage").read
effectively 'memory maps' the JSON that's in flash memory, so it doesn't actually use up any RAM when it's sitting there as a string.It's only when you decode it with
JSON.parse
that it ends up using a bunch of memory