-
Sun 2021.04.25
'what is the maximum length of storable/runnable javascript code in Espruino wifi?'
Use
process.memory()
to determine the amount of free JsVarshttp://www.espruino.com/Reference#l_process_memory
JsVars: https://www.espruino.com/InternalsAlthough it may be possible to use some fancy techinques to utilize flash in addition to available ROM, typically, Espruino needs as much memory as the code file size being uploaded, in order to unpack and reorganize in memory.
Really rough approximation; take the number of free JsVars and divide by two to account for the need to reorganize during the upload process, then multiply by 16 bytes per JsVar.
I don't have a WiFi handy, but if memory serves, an authentic Espruino Wifi provides around 2200 JsVars.
2200 / 2 * 16 = 17,600 chars rough approximation
-
Do you know what is the maximum length of storable/runnable javascript code in Espruino wifi?
require("Storage").getFree()
-this is space when saving code to flash. as for html you can even upload parts of your pages as separate files to Storage and then use Storage.read("filename") in place of the strings, maybe the utf-8 encoding could be better with that.
this might help to display the chars correct in browser
https://dev.w3.org/html5/html-author/charref
three ways to code chars, pick your favorite one