Not sure. But I know the converse is possible: you can write libraries in C, and expose methods as JavaScript objects and functions.
When you build Espruino, the build scripts scan your C code for /*JSON{… comments, in which you describe the mapping between C and JavaScript.
/*JSON{…
Some of that is documented here: https://github.com/espruino/Espruino/blob/master/libs/README.md
I'd also suggest taking a look at the C source of Espruino's built-in libraries, like Math, to see actually working examples.
@oesterle started
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.
Not sure. But I know the converse is possible: you can write libraries in C, and expose methods as JavaScript objects and functions.
When you build Espruino, the build scripts scan your C code for
/*JSON{…
comments, in which you describe the mapping between C and JavaScript.Some of that is documented here:
https://github.com/espruino/Espruino/blob/master/libs/README.md
I'd also suggest taking a look at the C source of Espruino's built-in libraries, like Math, to see actually working examples.