Skip to content

Commit

Permalink
doc: drop 'Note that' in addons docs
Browse files Browse the repository at this point in the history
This commit removes the usage of 'Note that' in the addons
documentation. Note that this phrase was not adding anything
meaningful to the docs.

PR-URL: #28327
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
cjihrig committed Jun 22, 2019
1 parent c6f959a commit a03f256
Showing 1 changed file with 8 additions and 9 deletions.
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

0 comments on commit a03f256

Please sign in to comment.