in other words, exports is provided in the context of `.addCached() when executing the passed in (anonymous) function for the 'moduleSource' parameter... (I finally understand what a recent release mentioned with 'ability to store or storing a module as a function' - is it that or is that at least related to it?).
Therefore, instead of using concatenated or multi-line string to pass in the module source, the module 'source' is wrapped with an (anonymous) function that sets or populates the exports object.
I will use this function approach to replace the string approach in mentioned conversation about Module Development. It fulfills *exactly* the same requirements I have with a better support. Syntax highlighting and (Espruino extended,) specific code completion are just two - important - parts of it, all provided by the Espruino IDE.
...all with enabling all sorts of makers in mind. (@Gordon, is that - or at least a major port of it - not what ignited the Espruino-Journey in the first place?)
PS: it's about time for me to really really dig into the Espruino source code... or not... I'm confused... ;-)
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.
@Gordon, that's excellent...
in other words,
exports
is provided in the context of `.addCached() when executing the passed in (anonymous) function for the 'moduleSource' parameter... (I finally understand what a recent release mentioned with 'ability to store or storing a module as a function' - is it that or is that at least related to it?).Therefore, instead of using concatenated or multi-line string to pass in the module source, the module 'source' is wrapped with an (anonymous) function that sets or populates the
exports
object.I will use this function approach to replace the string approach in mentioned conversation about Module Development. It fulfills *exactly* the same requirements I have with a better support. Syntax highlighting and (Espruino extended,) specific code completion are just two - important - parts of it, all provided by the Espruino IDE.
...all with enabling all sorts of makers in mind. (@Gordon, is that - or at least a major port of it - not what ignited the Espruino-Journey in the first place?)
PS: it's about time for me to really really dig into the Espruino source code... or not... I'm confused... ;-)