| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0ad55e5 commit 331e5e8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ There are three options for implementing addons: | |||
| 14 | 14 | * `nan` ([Native Abstractions for Node.js][]) | |
| 15 | 15 | * direct use of internal V8, libuv, and Node.js libraries | |
| 16 | 16 | ||
| 17 | - This rest of this document focuses on the latter, requiring | ||
| 17 | + The rest of this document focuses on the latter, requiring | ||
| 18 | 18 | knowledge of multiple components and APIs: | |
| 19 | 19 | ||
| 20 | 20 | * [V8][]: the C++ library Node.js uses to provide the | |
@@ -113,7 +113,7 @@ To integrate with the npm ecosystem, see the [Building][] section. | |||
| 113 | 113 | ||
| 114 | 114 | ### Context-aware addons | |
| 115 | 115 | ||
| 116 | - Addons defined with `NODE_MODULE()` can not be loaded in multiple contexts or | ||
| 116 | + Addons defined with `NODE_MODULE()` cannot be loaded in multiple contexts or | ||
| 117 | 117 | multiple threads at the same time. | |
| 118 | 118 | ||
| 119 | 119 | There are environments in which Node.js addons may need to be loaded multiple | |
@@ -255,7 +255,7 @@ changes: | |||
| 255 | 255 | In order to be loaded from multiple Node.js environments, | |
| 256 | 256 | such as a main thread and a Worker thread, an add-on needs to either: | |
| 257 | 257 | ||
| 258 | - * Be an [Node-API][] addon. | ||
| 258 | + * Be a [Node-API][] addon. | ||
| 259 | 259 | * Be declared as context-aware using `NODE_MODULE_INIT()` as described above. | |
| 260 | 260 | ||
| 261 | 261 | In order to support [`Worker`][] threads, addons need to clean up any resources | |
@@ -483,13 +483,13 @@ See [C/C++ addons with Node-API][Node-API]. | |||
| 483 | 483 | ||
| 484 | 484 | ## Addon examples | |
| 485 | 485 | ||
| 486 | - Following are some example addons intended to help developers get started. The | ||
| 486 | + The following are some example addons intended to help developers get started. The | ||
| 487 | 487 | examples use the V8 APIs. Refer to the online [V8 reference][v8-docs] | |
| 488 | 488 | for help with the various V8 calls, and V8's [Embedder's Guide][] for an | |
| 489 | 489 | explanation of several concepts used such as handles, scopes, function | |
| 490 | 490 | templates, etc. | |
| 491 | 491 | ||
| 492 | - Each of these examples using the following `binding.gyp` file: | ||
| 492 | + Each of these examples uses the following `binding.gyp` file: | ||
| 493 | 493 | ||
| 494 | 494 | ```json | |
| 495 | 495 | { | |
@@ -951,7 +951,7 @@ provided by the underlying V8 JavaScript engine. They are subject to change | |||
| 951 | 951 | or removal at any time. They are not documented by Node.js or V8, and they | |
| 952 | 952 | should never be used outside of testing. | |
| 953 | 953 | ||
| 954 | - During shutdown of the process or worker threads destructors are not called | ||
| 954 | + During shutdown of the process or worker threads, destructors are not called | ||
| 955 | 955 | by the JS engine. Therefore it's the responsibility of the user to track | |
| 956 | 956 | these objects and ensure proper destruction to avoid resource leaks. | |
| 957 | 957 | ||
@@ -1171,7 +1171,7 @@ console.log(obj2.plusOne()); | |||
| 1171 | 1171 | ||
| 1172 | 1172 | In addition to wrapping and returning C++ objects, it is possible to pass | |
| 1173 | 1173 | wrapped objects around by unwrapping them with the Node.js helper function | |
| 1174 | - `node::ObjectWrap::Unwrap`. The following examples shows a function `add()` | ||
| 1174 | + `node::ObjectWrap::Unwrap`. The following example shows a function `add()` | ||
| 1175 | 1175 | that can take two `MyObject` objects as input arguments: | |
| 1176 | 1176 | ||
| 1177 | 1177 | ```cpp | |
| Back | FazBrowse Home | New Git URL |
0 commit comments