You are reading a single comment by @the1laz and its replies. Click here to read the full conversation.
  • Continuing from the other thread, I think this would be great:

    //Your networking code here
    
    var bootcode = require('bootcode').init();
    

    Where init goes through and takes a record of the existing modules, vars, etc and stores them. Then it links bootcode.reset to the native reset function, replaces reset() with a function that resets and deletes everything that's not required. If your networking code is all stored in a module too, you only need to put this into your Espruino when you first run it:

    var wifi = require('my network').init();var bootcode = require('bootcode').init();
    

    @Gordon - Coming from someone who doesn't know a lot about the internals, would it be possible to add a step in compilation that writes a .js file into the binary as an initial program? It would also be useful for the boards you sell, as you could send them out with a tutorial built into them.

About

Avatar for the1laz @the1laz started