After following instructions on the emscripten wiki I have managed to compile a small C library. This resulted in an a.out.js file.
I was assuming that to use functions from this library (within node.js) something like this would have worked:
var lib = require("./a.out.js");
lib.myFunction('test');
However this fails. Can anyone help or point me to some basic tutorial related to this?
The problem here is that your
a.out.jsfile is going to look like thisNot like this
You need to write a build script that lists the tokens you want to publically export from each C program and appends
exports.<token> = <token>;\nto the end of your file for each token.