• We can also cache Modules in Eprom, and load on demand:

    var fs = new(require("FlashStoreWrite"))(0x7c000)­;
    // Save module source in EEPROM
    fs.item('clock').wget('http://www.esprui­no.com/modules/clock.min.js');
    
    var fs = new(require("FlashStore"))(0x7c000);
    // Retrieve module source, add to module cache and then use..
    require( fs.item('clock').module() );
    var Clock = require("clock").Clock;
    var clk=new Clock(2014,4,15,23,45,0,0);
    

    require( fs.item('clock').module() );
    ={ "Clock": function () { ... } }
    var Clock = require("clock").Clock;
    =function () { ... }
    var clk=new Clock(2014,4,15,23,45,0,0);
    ={ "lastTime": 1457230986.79778003692, "date": { "ms": 1400197500000 } }

    This means you can use require on the left hand side of the IDE on a pre-cached module, and then use that module.

About

Avatar for Wilberforce @Wilberforce started