I read this tutorial about wasm and after point 3. "Calling a custom function defined in C" I tried to figure out how to bind C++ functions and classes to JavaScript in that manner? Do I have to use Embind there for, but how?
I also found this thread and the second answer from @lacenen could be a workaround.