// global vars
var release = false;
......
// functions, classes .....
......
// this will be called on power up, if code was saved
onInit(){ ... }
if (release) {
// save code to flash, to make code permanent
setTimeout(save,1E3);
} else {
// or just start onInit, typical way if you are still developing and testing
setTimeout(onInit,1E3);
}
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.
this is what I use now:
Edit: added missing curly bracket open in line 12