I'm just updating those docs for modules. The following works:
function loadModule(moduleName, callback) { require("http").get("http://www.espruino.com/modules/"+moduleName+".js", function(res) { var contents = ""; res.on('data', function(data) { contents += data; }); res.on('close', function() { Modules.addCached(moduleName, contents); if (callback) callback(); }); }).on('error', function(e) { console.log("ERROR", e); }); }
(but it's not synchronous)
@Gordon started
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.
I'm just updating those docs for modules. The following works:
(but it's not synchronous)