-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: add "Hello world" example for N-API #17425
doc: add "Hello world" example for N-API #17425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo style nit.
doc/api/addons.md
Outdated
napi_status status; | ||
napi_value fn; | ||
|
||
status = napi_create_function(env, NULL, 0, Method, NULL, &fn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullptr (2x)
Our Addons documentation has a "Hello world" example that outlines all steps to build it. Adding the sources for this "Hello world" example for N-API.
4d9b7fb
to
7d4e033
Compare
return greeting; | ||
} | ||
|
||
napi_value init(napi_env env, napi_value exports) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init should be uppercase by convention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simple addon example on that page uses lower case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once nits are addressed
Looks good to go: ci run: https://ci.nodejs.org/job/node-test-pull-request/11951/ |
Landed in 5279035 |
Our Addons documentation has a "Hello world" example that outlines all steps to build it. Adding the sources for this "Hello world" example for N-API. PR-URL: #17425 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Our Addons documentation has a "Hello world" example that outlines all steps to build it. Adding the sources for this "Hello world" example for N-API. PR-URL: #17425 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Our Addons documentation has a "Hello world" example that outlines all steps to build it. Adding the sources for this "Hello world" example for N-API. PR-URL: #17425 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Our Addons documentation has a "Hello world" example that outlines all steps to build it. Adding the sources for this "Hello world" example for N-API. PR-URL: #17425 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Our Addons documentation has a "Hello world" example that outlines all steps to build it. Adding the sources for this "Hello world" example for N-API. PR-URL: #17425 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Our Addons documentation has a "Hello world" example that
outlines all steps to build it. Adding the sources for this
"Hello world" example for N-API.
Checklist
Affected core subsystem(s)
doc