You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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:

    schedule = require("heatshrink").compress(require("Storage").read("CustomSchedul­e.json"));
    

    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

About

Avatar for Gordon @Gordon started