// the module
exports = function () {
console.log('I am the module');
};
// the consumer
var module = require('my-module');
module(); // I am the module
In fact I think even prefixing your module with var module=this; will work.
But yes, I'll make sure that there's a modules variable - I've filed a bug
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.
Right now the following works:
In fact I think even prefixing your module with
var module=this;
will work.But yes, I'll make sure that there's a modules variable - I've filed a bug