• Sounds like someone had working code thrashed by a change to a module?

    I totally understand the motivation for these features. Currently, there isn't a direct way to copy files to the SD card in the Espruino from a computer. I suppose the IDE could send reset(); var fs=require("fs"); fs.writeFile("/node_modules/first_moduleĀ­.min.js", "content of module goes here"); The diff could be achieved in a similar way - but either of these are a little awkward. It would be really cool to be able to put things onto the SD card easily through the WebIDE though.

    You could also take the SD card out, and load the files onto it that way using the usual tools.

    Also - are you aware that you can specify a URL in the require statement, ie:

    require("http://localhost/module.js")

    This will still only work if the require statement is sent from the right-pane of the IDE, but at least it gives you control over the module that gets loaded without having to have stuff on the SD card. For the webserver, I'd recommend XAMPP on windows (note - if UAC is enabled, you'll need to set the shortcut to the control panel to always run as admin under properties -> compatibility), or Apache on Linux. Either of these can just be installed (almost all linux distros include or have an easy way to install Apache) and used without further configuration.

    Edit: Just remembered a caveat to specifying URLs when doing require - the modules get cached, and there doesn't seem to be a way to clear the cache. I'm not sure what resets it - probably restarting the webIDE. Clearing Chrome's cache doesn't work, though. This means that if you're developing a module and testing it that way, each version needs a different file name... Though at least you have all the intermediate versions afterwards.

About

Avatar for DrAzzy @DrAzzy started