You can confuse the IDE into not looking for the module online like so:
var modname="modulename";
var device=require(modname).connect(...);
Also, require()'s entered on the left side of the IDE will never use the module from the internet (it's going direct to the Espruino).
I agree that it would be a nice feature addition to be able to disable searching for modules online.
At the same time - if you're doing much development of a module on the SD card, that's a heck of a lot of swapping around of SD cards. You can also install XAMPP and use that as a local webserver, and do:
var device=require("http://localhost/modulename.js");
(unfortunately, on default settings, XAMPP-apache serves files such that they get cached, so you have to use a different file name for each revision - there's a way to change this so apache sends headers that say not to cache, but I've had a hard time figuring it out :-/ - frankly, having to change the name of the file every time is no bad thing if you're not using source control - having those old debug versions around has come in handy on a number of occasions)
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.
You can confuse the IDE into not looking for the module online like so:
Also, require()'s entered on the left side of the IDE will never use the module from the internet (it's going direct to the Espruino).
I agree that it would be a nice feature addition to be able to disable searching for modules online.
At the same time - if you're doing much development of a module on the SD card, that's a heck of a lot of swapping around of SD cards. You can also install XAMPP and use that as a local webserver, and do:
(unfortunately, on default settings, XAMPP-apache serves files such that they get cached, so you have to use a different file name for each revision - there's a way to change this so apache sends headers that say not to cache, but I've had a hard time figuring it out :-/ - frankly, having to change the name of the file every time is no bad thing if you're not using source control - having those old debug versions around has come in handy on a number of occasions)