I have some pretty simple questions.
I have looked on Internet for answers on these questions but I could find any. I'm sorry if this is one of the must know things, but I started with addons recently.
There are four different interfaces for a Node.js addons
node.h
(C++) which is no interface at all - in this case you will have to deal with different V8/Node.js versions - which is very hard and cumbersome;worker_threads
;napi.h
(C) which has an uniform ABI across all versions - meaning that a binary module built for one version will work with all later versions;napi.h
that allows you to use NAPI with C++ semantics. It is fully compatible with napi.h
and you can mix the two.For a new module, Node Addon API is by far the best choice.