• Go back and have a look at the sample: http://www.espruino.com/Writing+Modules

    You need to add a constructor function and export the reference to that.

    The bind your contants to that function. so if you called it myMod :

    var myMod = function (options) {
      this.options = {}    || options;
    };
    
    
    myMod.C = {
      U : "up",
      D : "down",
      L : "left",
      R : "right",
      N : "north",
      E : "east",
      S : "south",
      W : "west",
      T : "top",
      M : "middle",
      B : "bottom"
    };
    
    exports = myMod;
    
    my_mod=new myMod();
    print my_mod.C.U;
    
About

Avatar for Wilberforce @Wilberforce started