You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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)

About

Avatar for Gordon @Gordon started