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:
node-ffi seems to be primarily for C programs. I went through this in the last week, and found much better luck with node addons. What you have to do is write a shim between the C++ code in the library and node.js. In my case, I needed to encode and decode packets for a security protocol, so I made node buffers that contained the packets, and wrote C++ code that got the data out of the buffers, then send the data to my C code that encoded and decoded packets.
This page: http://luismreis.github.io/node-bindings-guide/docs/returning.html has some great examples of how to get data in and out of node.js buffers in C++.