node.js-addon

node-ffi vs. node extension for accessing existing C++ functionality

谁说我不能喝 提交于 2019-11-29 06:06:01
问题 I've got some existing C++ code that does numerical processing within a stand-alone C++ application. I now want to use that code within a new node.js application. Researching how to access C++ code from node.js, two options come up: Write a node.js extension Use node-ffi node-ffi seems like a good option to access existing libraries , but am I right thinking if I use node-ffi I would have to write a C wrapper to make my C++ accessible? (This was the only way I could get a simple test case to

Call C++ library from Node.js (Node addons / node-ffi)

≡放荡痞女 提交于 2019-11-27 21:35:42
I'm trying to integrate an external C++ library (I have access to the .so file as well as the header files) into my Node.js application. After a lot of research my options are reduced to: Writing a Node addon Use node-ffi From node-ffi's gitHub's definition I can't tell if it will or will not work directly on C++ libraries: node-ffi is a Node.js addon for loading and calling dynamic libraries using pure JavaScript. It can be used to create bindings to native libraries without writing any C++ code. So the questions I have are: Does option 1) imply rewriting in some way the external C++ library?

Call C++ library from Node.js (Node addons / node-ffi)

爷,独闯天下 提交于 2019-11-26 20:43:26
问题 I'm trying to integrate an external C++ library (I have access to the .so file as well as the header files) into my Node.js application. After a lot of research my options are reduced to: Writing a Node addon Use node-ffi From node-ffi's gitHub's definition I can't tell if it will or will not work directly on C++ libraries: node-ffi is a Node.js addon for loading and calling dynamic libraries using pure JavaScript. It can be used to create bindings to native libraries without writing any C++