Skip to content
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: drop 'Note that' in addons docs #28327

Merged
merged 1 commit into from
Jun 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)
} // namespace demo
```

Note that all Node.js Addons must export an initialization function following
All Node.js Addons must export an initialization function following
the pattern:

```cpp
Expand Down Expand Up @@ -310,9 +310,8 @@ Because the exact path to the compiled Addon binary can vary depending on how
it is compiled (i.e. sometimes it may be in `./build/Debug/`), Addons can use
the [bindings][] package to load the compiled module.

Note that while the `bindings` package implementation is more sophisticated
in how it locates Addon modules, it is essentially using a try-catch pattern
similar to:
While the `bindings` package implementation is more sophisticated in how it
locates Addon modules, it is essentially using a try-catch pattern similar to:

```js
try {
Expand Down Expand Up @@ -588,10 +587,10 @@ NODE_MODULE(NODE_GYP_MODULE_NAME, Init)
} // namespace demo
```

Note that this example uses a two-argument form of `Init()` that receives
the full `module` object as the second argument. This allows the Addon
to completely overwrite `exports` with a single function instead of
adding the function as a property of `exports`.
This example uses a two-argument form of `Init()` that receives the full
`module` object as the second argument. This allows the Addon to completely
overwrite `exports` with a single function instead of adding the function as a
property of `exports`.

To test it, run the following JavaScript:

Expand All @@ -605,7 +604,7 @@ addon((msg) => {
});
```

Note that, in this example, the callback function is invoked synchronously.
In this example, the callback function is invoked synchronously.

### Object factory

Expand Down