In your announcement blog post you write
JavaScript code can also make direct synchronous calls into native code (Java, Objective C, Swift) and get calls back from it, by means of Node’s native add-on APIs (the V8 API and N-API are both available).
How does this work exactly?
I'm trying to use the ffi on iOS. I ship my own node_modules folder, which I add to process.env.NODE_PATH at runtime.
The issue is that node-gyp simply didn't build the native modules for arm64 in the first place.
const ffi = require('ffi');
throws the following error:
dlopen(PATH_TO_APP/Frameworks/NodeJSKit.framework/node_modules/ref/build/Release/binding.node, 1): no suitable image found. Did find:
PATH_TO_APP/Frameworks/NodeJSKit.framework/node_modules/ref/build/Release/binding.node: mach-o, but wrong architecture
PATH_TO_APP/Frameworks/NodeJSKit.framework/node_modules/ref/build/Release/binding.node: mach-o, but wrong architecture
Is it possible to build native node addons written in c++ (that use the v8 api or the newer N-API) to work with nodejs-mobile?
In your announcement blog post you write
How does this work exactly?
I'm trying to use the
ffion iOS. I ship my ownnode_modulesfolder, which I add toprocess.env.NODE_PATHat runtime.The issue is that
node-gypsimply didn't build the native modules for arm64 in the first place.throws the following error:
Is it possible to build native node addons written in c++ (that use the v8 api or the newer N-API) to work with nodejs-mobile?