It provides a nice, safe interface to the flash memory which allows you to read and write data pretty easily. It also does it in a way that will be careful not to wear out flash memory if you do lots of writes.
There are some good examples of usage on that page - for instance:
var f = new (require("FlashEEPROM"))();
f.write(0, "Hello");
f.write(1, "World");
//.. you can write to any address between 0 and 255, with any data up to 65536 chars long
f.read(0)
// returns new Uint8Array([72, 101, 108, 108, 111])
E.toString(f.read(1))
// returns "World"
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'd suggest you use the
FlashEEPROM
module: http://www.espruino.com/FlashEEPROMIt provides a nice, safe interface to the flash memory which allows you to read and write data pretty easily. It also does it in a way that will be careful not to wear out flash memory if you do lots of writes.
There are some good examples of usage on that page - for instance: