You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • At the moment there's nothing built in, and adding the module loading (despite it still being in the docs) is actually very low priority.

    The problem (much like on desktop) is that the require call is synchronous but the actual HTTP GET is async, so it would be a bit tricky to combine them. And while it might be possible to hack around it on normal Espruino boards, on ESP8266 I think it would likely fail completely (because it really dislikes functions that take a long time to execute).

    However nothing stops you from writing your own async loadModule function that you can call yourself (which will work on all platforms) - it just can't be automatic. All it has to do is request the JS file from http://www.espruino.com/modules/ and then call http://www.espruino.com/Reference#l_Modu­les_addCached with it as a string.

About

Avatar for Gordon @Gordon started