Description
I spend a lot of time trying to find things when working with the napi.h
API.
Finding things is quite confusing because there is a website with (outdated?) Doxygen documentation here https://nodejs.github.io/node-addon-api/napi_8h_source.html
.
The main, up-to-date sourcecode seems to be here https://github.com/nodejs/node-addon-api
.
But the usage examples seem to be here https://github.com/nodejs/abi-stable-node-addon-examples/tree/master/1_hello_world/node-addon-api
.
And the name of the project, node-addon-api
is not very distinguishable from the the built-in node project named abi-stable-node
which it wraps.
The usage examples for napi.h
code are in the repo named abi-stable-node-addon-examples
. This name would imply that usage examples should be of the C
N-API
API found under abi-stable-node
, but instead we find usage examples there of the node-addon-api
.
All of this is confusing to a new user of the API. Some explanation up-front in the main readme.md as to the different projects, names, urls, statuses and relationships, as well as either an update or a takedown of https://nodejs.github.io/node-addon-api/napi_8h_source.html
would be helpful.
Ultimately, folding this project into Node.js directly would make a lot of sense to me, and the Node.js documentation itself should say, here's the ABI stable C API named 'N-API'
and heres the C++ wrapper for 'N-API' named 'N-API-CPP
.
Here is a Stack Overflow question I opened, which got tumbleweeds, that illustrates the challenges.