You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Thanks!

    There's a bit of info on adding your own libraries here: https://github.com/espruino/Espruino/blo­b/master/libs/README.md

    I'd do that, but just add an init function that gets called automatically:

    /*JSON{
      "type" : "init",
      "generate" : "jswrap_foobar_init"
    }*/
    void jswrap_foobar_init() {
     jsvUnLock(jspEvaluate("your_js_code_here­", true));
    }
    

    The neat thing with that is that while things you define still go into RAM, the actual JS code of the functions will stay in flash memory.

    I am working on another option which will let you add JS modules without using up any RAM at all, but that's still a way off being usable.

About

Avatar for Gordon @Gordon started