-
• #2
Just opening this again to mention this page, which has your answer: https://github.com/espruino/Espruino/blob/master/libs/README.md
-
• #3
Thank you, Gordon.
"type" : "library" , for a built-in module as a library,
and in JS code: var m = require('yourmodule');"type" : "class" , for a built-in module as a Object,
and in JS code: yourmodule.method();
How to expose a c/c++ module to Espruino JS?
For example, the jswrap_hello.c defines the 'Hello' class , it has a method 'world()', then we can do in Espruino:
How to expose 'Hello' as a module just like 'net' or 'Wifi'? I mean 'Hello' can be required like this:
or