Skip to content

Commit

Permalink
doc: update blurb explaining NODE_ADDON_API
Browse files Browse the repository at this point in the history
Fixes: #249
PR-URL: #251
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
Gabriel Schulhof committed Apr 30, 2018
1 parent cf6c93e commit 341dbd2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/node-gyp.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
/**
* This code defines the entry-point for the Node addon, it tells Node where to go
* once the library has been loaded into active memory. The first argument must
* match the "target" in our *binding.gyp*. The second argument points to the
* function to invoke.
* match the "target" in our *binding.gyp*. Using NODE_GYP_MODULE_NAME ensures
* that the argument will be correct, as long as the module is built with
* node-gyp (which is the usual way of building modules). The second argument
* points to the function to invoke. The function must not be namespaced.
*/
NODE_API_MODULE(myModule, Init)
NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init)
```

## **node-gyp** reference
Expand Down

0 comments on commit 341dbd2

Please sign in to comment.