Add example that uses NODE_API_ADDON for addon registration
KevinEady opened this issue · 3 comments
KevinEady commented
It appears that all of our examples use the NODE_API_MODULE
macro to register native addons. It would be helpful to add an
example that uses NODE_API_ADDON
registration, where the module extends Addon<T>
.
KevinEady commented
This issue was raised because of a question on node-addon-api on when to use which macro: nodejs/node-addon-api#1190
UrielCh commented
Hi,
I want to write a new Binding for openCV, and since I'm writing it from scratch, I want to make it as up-to-date as possible.
So I would like to use NODE_API_ADDON
My current sample code is here
the code builds fine, but my exported object is empty.
gabrielschulhof commented
This issue was resolved in #209.