@graf - @mgg1010's method should work fine. AFAIK nothing stops you from doing new require("foo").Bar.
@mgg1010 - very odd about your issues with the files from http. I actually just tried here and got some problems too. Try turning on throttle send in settings and see if that helps (it'll be slower though).
It looks like it's taking a while for Espruino to receive/execute the module, as it gets turned into a giant string and sent over (rather than being able to be executed line by line). It means it's losing some characters - although I really hoped I'd fixed that in 1v61.
I guess the easy fix would be to add the option to auto-minify modules, as currently clicking the 'minify' option will minify the RHS, but not any modules it loads.
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.
@graf - @mgg1010's method should work fine. AFAIK nothing stops you from doing
new require("foo").Bar
.@mgg1010 - very odd about your issues with the files from http. I actually just tried here and got some problems too. Try turning on
throttle send
in settings and see if that helps (it'll be slower though).It looks like it's taking a while for Espruino to receive/execute the module, as it gets turned into a giant string and sent over (rather than being able to be executed line by line). It means it's losing some characters - although I really hoped I'd fixed that in 1v61.
I guess the easy fix would be to add the option to auto-minify modules, as currently clicking the 'minify' option will minify the RHS, but not any modules it loads.