QuickJS: creating a shared c module and import it as a module in js
- After a day exploration and a lot of frustration, finaly some clarity found thanks to https://github.com/khanhas/minnet-quickjs
- the first few lines of your .c/.h files are very important !
#define countof(x) (sizeof(x) / sizeof((x)[0]))
=> this one should be copy & pasted, or inclued
- the JS_INIT_MOULE is also critical as quickjs relies on that ! typos are critical (spent an hour on a typo ...)