I routinely access compiled c++ modules in js modules by passing in the module name as an argument when creating the other module, like so:
var cppModule = require('./cppModule');
var cppModObject = new cppModule.SomeObject;
var jsModule = require('./jsModule');
var jsModObject = new jsModule.OtherObject(cppModObject);
And in my js I have something like:
var jsModule = function(otherModArg) {
var otherModuleObject = otherModArg;
...
}
My question is whether I can do the reverse, i.e. pass in some instantiated js object into my c++ module and access that object within the c++. I'm happy to post more code if it would be helpful...I haven't been able to find any doc on this yet. Thanks!