I am not able to call a C function in another JavaScript file, it is giving the error 'called before runtime initialization' please refer to this link
I compiled the C code in emscripten as described in the given link and used generated asm.js file in my test.js file. command used to generate asm :-
emcc test/hello.cpp -o hello.html -s EXPORTED_FUNCTIONS="['_int_sqrt']" -s EXPORTED_RUNTIME_METHODS="["ccall", "cwrap"]"
code in test.js file :
var Module = require('./asm.js');
var test = Module.cwrap('int_sqrt', 'number', ['number']);
console.log(test(25));
and when I run node test
it gives the error
abort(Assertion failed: native function `int_sqrt` called before runtime initialization)