Call C++ from Node-Red (Node.js)

Hello,
Node-Red and Node.js are essentially written in C++.
Therefore, there is a C++ interface to Node.js.
Most of my nodes are written with it.
I wanted to share a document with you on how it works.
Have fun.

call_cpp_from_nodejs.pdf (272.5 KB)

6 Likes

Love it. thanks for sharing.

Do you happen to have similar articles for go, zig and rust :crossed_fingers:

No, but for rust look here:

2 Likes

Que: Node Red Nodes that use licensing and IP protection :sunglasses:

Very cool writeup @iiot2k :pray:

(I have tagged this post with a few things for the crawlers)

1 Like

I'm not a C++ guy (.NET Fra.... cough, cough)

Could you use this as a carrier/proxy? to utilise other libs not natively compiled for Node?

Example: We use Barracuda Firewall appliances, and their comms are IP'd to Shizzle!
and we must use their provided Dll to communicate with the hardware, will be great to import that lib into a Node RED Node - using your guide, as the basis for a carrier to dip into their lib

Hi Marcus,
Hope I understood your question correctly.
You can use any C++ library (dll or .so).
In the end, the extension .node is a dll or .so
For example, I included the SQLite library and all SQL calls were encapsulated in the .node.
Of course, you have to be careful with multi-threads.
Node.js is single-threaded by nature.
This can cause problems.
But this problem can be solved if you are familiar with the thread mechanism in Linux or Windows.

Derya

1 Like

:point_up: that.... answered my question - cool!

Thanks

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.