node-addon-api 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +67 -47
  3. package/napi-inl.deprecated.h +8 -8
  4. package/napi-inl.h +118 -80
  5. package/napi.h +513 -424
  6. package/package.json +25 -5
  7. package/tools/clang-format.js +30 -10
  8. package/.clang-format +0 -111
  9. package/.editorconfig +0 -8
  10. package/.github/workflows/ci.yml +0 -55
  11. package/.github/workflows/linter.yml +0 -24
  12. package/.github/workflows/stale.yml +0 -18
  13. package/.travis.yml +0 -58
  14. package/CODE_OF_CONDUCT.md +0 -4
  15. package/CONTRIBUTING.md +0 -66
  16. package/appveyor.yml +0 -37
  17. package/benchmark/README.md +0 -47
  18. package/benchmark/binding.gyp +0 -25
  19. package/benchmark/function_args.cc +0 -217
  20. package/benchmark/function_args.js +0 -60
  21. package/benchmark/index.js +0 -34
  22. package/benchmark/property_descriptor.cc +0 -91
  23. package/benchmark/property_descriptor.js +0 -37
  24. package/doc/addon.md +0 -157
  25. package/doc/array.md +0 -81
  26. package/doc/array_buffer.md +0 -149
  27. package/doc/async_context.md +0 -86
  28. package/doc/async_operations.md +0 -31
  29. package/doc/async_worker.md +0 -427
  30. package/doc/async_worker_variants.md +0 -557
  31. package/doc/bigint.md +0 -97
  32. package/doc/boolean.md +0 -68
  33. package/doc/buffer.md +0 -144
  34. package/doc/callback_scope.md +0 -54
  35. package/doc/callbackinfo.md +0 -97
  36. package/doc/checker-tool.md +0 -32
  37. package/doc/class_property_descriptor.md +0 -117
  38. package/doc/cmake-js.md +0 -68
  39. package/doc/conversion-tool.md +0 -28
  40. package/doc/creating_a_release.md +0 -62
  41. package/doc/dataview.md +0 -248
  42. package/doc/date.md +0 -68
  43. package/doc/env.md +0 -132
  44. package/doc/error.md +0 -120
  45. package/doc/error_handling.md +0 -186
  46. package/doc/escapable_handle_scope.md +0 -82
  47. package/doc/external.md +0 -63
  48. package/doc/function.md +0 -402
  49. package/doc/function_reference.md +0 -238
  50. package/doc/generator.md +0 -13
  51. package/doc/handle_scope.md +0 -65
  52. package/doc/hierarchy.md +0 -91
  53. package/doc/instance_wrap.md +0 -408
  54. package/doc/memory_management.md +0 -27
  55. package/doc/name.md +0 -29
  56. package/doc/node-gyp.md +0 -82
  57. package/doc/number.md +0 -163
  58. package/doc/object.md +0 -279
  59. package/doc/object_lifetime_management.md +0 -83
  60. package/doc/object_reference.md +0 -117
  61. package/doc/object_wrap.md +0 -561
  62. package/doc/prebuild_tools.md +0 -16
  63. package/doc/promises.md +0 -79
  64. package/doc/property_descriptor.md +0 -286
  65. package/doc/range_error.md +0 -59
  66. package/doc/reference.md +0 -111
  67. package/doc/setup.md +0 -81
  68. package/doc/string.md +0 -93
  69. package/doc/symbol.md +0 -48
  70. package/doc/threadsafe.md +0 -121
  71. package/doc/threadsafe_function.md +0 -290
  72. package/doc/type_error.md +0 -59
  73. package/doc/typed_array.md +0 -78
  74. package/doc/typed_array_of.md +0 -137
  75. package/doc/typed_threadsafe_function.md +0 -307
  76. package/doc/value.md +0 -340
  77. package/doc/version_management.md +0 -43
package/CHANGELOG.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # node-addon-api Changelog
2
2
 
3
+ ## 2021-05-17 Version 3.2.0, @NickNaso
4
+
5
+ ### Notable changes:
6
+
7
+ #### API
8
+
9
+ - Remove unnecessary symbol exposure.
10
+ - Fixed leak in `Napi::ObjectWrap` instance for getter and setter method.
11
+ - Added `Napi::Object::Freeze` and `Napi::object::Seal` methods.
12
+ - `Napi::Reference` is now copyable.
13
+
14
+ #### Documentation
15
+
16
+ - Added docuemtnation for `Napi::Object::PropertyLValue`.
17
+ - Changed all N-API references to Node-API.
18
+ - Some minor corrections all over the documentation.
19
+
20
+ #### TEST
21
+
22
+ - Added tests relating to fetch property from Global Object.
23
+ - Added addtiona tests for `Napi::Object`.
24
+ - Added test for `Napi::Function` contructors.
25
+ - Fixed intermittent failure for `Napi::ThreadSafeFunction` test.
26
+ - Some minor corrections all over the test suite.
27
+
28
+ ### TOOL
29
+
30
+ - Added Node.js v16.x to CI.
31
+ - Added CI configuration for Windows.
32
+ - Some fixex on linter command.
33
+
34
+ ### Commits
35
+
36
+ * [[`52721312f6`](https://github.com/nodejs/node-addon-api/commit/52721312f6)] - **docs**: add napi-rs iin Other Bindings section (#999) (LongYinan)
37
+ * [[`78a6570a42`](https://github.com/nodejs/node-addon-api/commit/78a6570a42)] - **doc**: fix typo in code example (#997) (Tobias Nießen)
38
+ * [[`da3bd5778f`](https://github.com/nodejs/node-addon-api/commit/da3bd5778f)] - **test**: fix undoc assumptions about the timing of tsfn calls (legendecas) [#995](https://github.com/nodejs/node-addon-api/pull/995)
39
+ * [[`410cf6a81e`](https://github.com/nodejs/node-addon-api/commit/410cf6a81e)] - **src**: return bool on object freeze and seal (#991) (legendecas)
40
+ * [[`93f1898312`](https://github.com/nodejs/node-addon-api/commit/93f1898312)] - **src**: return bool on object set and define property (#977) (legendecas)
41
+ * [[`331c2ee274`](https://github.com/nodejs/node-addon-api/commit/331c2ee274)] - **build**: add Node.js v16.x to CI (#983) (legendecas)
42
+ * [[`b6f5eb15e6`](https://github.com/nodejs/node-addon-api/commit/b6f5eb15e6)] - **test**: run test suites with helpers (legendecas) [#976](https://github.com/nodejs/node-addon-api/pull/976)
43
+ * [[`fbcdf00ea0`](https://github.com/nodejs/node-addon-api/commit/fbcdf00ea0)] - **test**: rename misspelled parameters (Tobias Nießen) [#973](https://github.com/nodejs/node-addon-api/pull/973)
44
+ * [[`63a6c32e80`](https://github.com/nodejs/node-addon-api/commit/63a6c32e80)] - **test**: fix intermittent TSFN crashes (Kevin Eady) [#974](https://github.com/nodejs/node-addon-api/pull/974)
45
+ * [[`8f120b033f`](https://github.com/nodejs/node-addon-api/commit/8f120b033f)] - **fix**: key for wapping drawing's system condition (#970) (Kévin VOYER)
46
+ * [[`1c9d528d66`](https://github.com/nodejs/node-addon-api/commit/1c9d528d66)] - **doc**: correct struct definition (#969) (Darshan Sen)
47
+ * [[`5e64d1fa61`](https://github.com/nodejs/node-addon-api/commit/5e64d1fa61)] - Added badges for Node-API v7 and v8. (#954) (Nicola Del Gobbo)
48
+ * [[`6ce629b3fa`](https://github.com/nodejs/node-addon-api/commit/6ce629b3fa)] - **src**: add pull request template (#967) (Michael Dawson)
49
+ * [[`98126661af`](https://github.com/nodejs/node-addon-api/commit/98126661af)] - Update CONTRIBUTING.md (#966) (Michael Dawson)
50
+ * [[`77350eee98`](https://github.com/nodejs/node-addon-api/commit/77350eee98)] - **src**: added Freeze and Seal method to Object class. (NickNaso) [#955](https://github.com/nodejs/node-addon-api/pull/955)
51
+ * [[`bc5147cc4a`](https://github.com/nodejs/node-addon-api/commit/bc5147cc4a)] - Finished tests relating to fetch property from Global Object (JckXia)
52
+ * [[`0127813111`](https://github.com/nodejs/node-addon-api/commit/0127813111)] - **doc**: unambiguously mark deprecated signatures (Tobias Nießen) [#942](https://github.com/nodejs/node-addon-api/pull/942)
53
+ * [[`787e216105`](https://github.com/nodejs/node-addon-api/commit/787e216105)] - **doc**: rename N-API with Node-API (Darshan Sen) [#951](https://github.com/nodejs/node-addon-api/pull/951)
54
+ * [[`628023689a`](https://github.com/nodejs/node-addon-api/commit/628023689a)] - **src**: rename N-API with Node-API on comments (NickNaso) [#953](https://github.com/nodejs/node-addon-api/pull/953)
55
+ * [[`5c6391578f`](https://github.com/nodejs/node-addon-api/commit/5c6391578f)] - **build**: add CI configuration for Windows (NickNaso) [#948](https://github.com/nodejs/node-addon-api/pull/948)
56
+ * [[`8ef07251ec`](https://github.com/nodejs/node-addon-api/commit/8ef07251ec)] - **doc**: added some warnings for buffer and array buffer factory method. (#929) (Nicola Del Gobbo)
57
+ * [[`6490b1f730`](https://github.com/nodejs/node-addon-api/commit/6490b1f730)] - **doc**: sync Object::Set value arg with Value::From (#933) (Tobias Nießen)
58
+ * [[`7319a0d7a2`](https://github.com/nodejs/node-addon-api/commit/7319a0d7a2)] - Fix tab indent (#938) (Tobias Nießen)
59
+ * [[`1916cb937e`](https://github.com/nodejs/node-addon-api/commit/1916cb937e)] - **chore**: fixup linter commands (#940) (legendecas)
60
+ * [[`fc4585fa23`](https://github.com/nodejs/node-addon-api/commit/fc4585fa23)] - **test**: dd tests for Function constructors (JoseExposito) [#937](https://github.com/nodejs/node-addon-api/pull/937)
61
+ * [[`87b7aae469`](https://github.com/nodejs/node-addon-api/commit/87b7aae469)] - **doc**: warn about SuppressDestruct() (#926) (Anna Henningsen)
62
+ * [[`71494a49a3`](https://github.com/nodejs/node-addon-api/commit/71494a49a3)] - **src,doc**: refactor to replace typedefs with usings (Darshan Sen) [#910](https://github.com/nodejs/node-addon-api/pull/910)
63
+ * [[`298ff8d9d2`](https://github.com/nodejs/node-addon-api/commit/298ff8d9d2)] - **test**: add additional tests for Object (JoseExposito) [#923](https://github.com/nodejs/node-addon-api/pull/923)
64
+ * [[`8a1147b430`](https://github.com/nodejs/node-addon-api/commit/8a1147b430)] - **revert**: src: add additional tests for Function (Michael Dawson)
65
+ * [[`bb56ffaa6f`](https://github.com/nodejs/node-addon-api/commit/bb56ffaa6f)] - **doc**: fix documentation for object api (Nicola Del Gobbo) [#931](https://github.com/nodejs/node-addon-api/pull/931)
66
+ * [[`3b8bddab49`](https://github.com/nodejs/node-addon-api/commit/3b8bddab49)] - **src**: add additional tests for Function (José Expósito) [#928](https://github.com/nodejs/node-addon-api/pull/928)
67
+ * [[`74ab50c775`](https://github.com/nodejs/node-addon-api/commit/74ab50c775)] - **src**: allow references to be copyable in APIs (legendecas) [#915](https://github.com/nodejs/node-addon-api/pull/915)
68
+ * [[`929709d0fe`](https://github.com/nodejs/node-addon-api/commit/929709d0fe)] - **doc**: add propertylvalue.md (#925) (Gabriel Schulhof)
69
+ * [[`69d0d98be4`](https://github.com/nodejs/node-addon-api/commit/69d0d98be4)] - fixup (Anna Henningsen)
70
+ * [[`46e41d961b`](https://github.com/nodejs/node-addon-api/commit/46e41d961b)] - fixup (Anna Henningsen)
71
+ * [[`1af1642fb7`](https://github.com/nodejs/node-addon-api/commit/1af1642fb7)] - **doc**: warn about SuppressDestruct() (Anna Henningsen)
72
+ * [[`12c548b2ff`](https://github.com/nodejs/node-addon-api/commit/12c548b2ff)] - **tools**: fix error detection (#914) (Darshan Sen)
73
+ * [[`458d895d5b`](https://github.com/nodejs/node-addon-api/commit/458d895d5b)] - **packaging**: list files to be published to npm (Lovell Fuller) [#889](https://github.com/nodejs/node-addon-api/pull/889)
74
+ * [[`f7ed2490d4`](https://github.com/nodejs/node-addon-api/commit/f7ed2490d4)] - **test**: remove outdated V8 flag (Darshan Sen) [#895](https://github.com/nodejs/node-addon-api/pull/895)
75
+ * [[`a575a6ec60`](https://github.com/nodejs/node-addon-api/commit/a575a6ec60)] - **src**: fix leak in ObjectWrap instance set/getters (Kevin Eady) [#899](https://github.com/nodejs/node-addon-api/pull/899)
76
+ * [[`b6e844e0b0`](https://github.com/nodejs/node-addon-api/commit/b6e844e0b0)] - **doc**: fix spelling of "targeted" and "targeting" (#904) (Tobias Nießen)
77
+ * [[`4d856f6e91`](https://github.com/nodejs/node-addon-api/commit/4d856f6e91)] - **src**: remove unnecessary symbol exposure (Gabriel Schulhof) [#896](https://github.com/nodejs/node-addon-api/pull/896)
78
+ * [[`f35bb7d0d7`](https://github.com/nodejs/node-addon-api/commit/f35bb7d0d7)] - **doc**: Update GitHub URL references from 'master' to 'HEAD' (#898) (Jim Schlight)
79
+ * [[`286ae215d1`](https://github.com/nodejs/node-addon-api/commit/286ae215d1)] - Add warning about branch rename (Michael Dawson)
80
+ * [[`a4a7b28288`](https://github.com/nodejs/node-addon-api/commit/a4a7b28288)] - Update branch references from master to main (#886) (Jim Schlight)
81
+ * [[`a2ad0a107a`](https://github.com/nodejs/node-addon-api/commit/a2ad0a107a)] - **docs**: add NAN to N-API resource link (#880) (kidneysolo)
82
+ * [[`1c040eeb63`](https://github.com/nodejs/node-addon-api/commit/1c040eeb63)] - **test**: load testModules automatically (raisinten) [#876](https://github.com/nodejs/node-addon-api/pull/876)
83
+ * [[`bf478e4496`](https://github.com/nodejs/node-addon-api/commit/bf478e4496)] - **src**: use NAPI\_NOEXCEPT macro instead of noexcept (NickNaso) [#864](https://github.com/nodejs/node-addon-api/pull/864)
84
+ * [[`744705f2eb`](https://github.com/nodejs/node-addon-api/commit/744705f2eb)] - **test**: refactor remove repeated execution index.js (raisinten) [#839](https://github.com/nodejs/node-addon-api/pull/839)
85
+ * [[`db62e3c811`](https://github.com/nodejs/node-addon-api/commit/db62e3c811)] - Update team members (Michael Dawson)
86
+
3
87
  ## 2020-12-17 Version 3.1.0, @NickNaso
4
88
 
5
89
  ### Notable changes:
package/README.md CHANGED
@@ -1,18 +1,29 @@
1
+ NOTE: The default branch has been renamed!
2
+ master is now named main
3
+
4
+ If you have a local clone, you can update it by running:
5
+
6
+ ```shell
7
+ git branch -m master main
8
+ git fetch origin
9
+ git branch -u origin/main main
10
+ ```
11
+
1
12
  # **node-addon-api module**
2
13
  This module contains **header-only C++ wrapper classes** which simplify
3
- the use of the C based [N-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
14
+ the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
4
15
  provided by Node.js when using C++. It provides a C++ object model
5
16
  and exception handling semantics with low overhead.
6
17
 
7
- There are three options for implementing addons: N-API, nan, or direct
18
+ There are three options for implementing addons: Node-API, nan, or direct
8
19
  use of internal V8, libuv and Node.js libraries. Unless there is a need for
9
- direct access to functionality which is not exposed by N-API as outlined
20
+ direct access to functionality which is not exposed by Node-API as outlined
10
21
  in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html)
11
- in Node.js core, use N-API. Refer to
12
- [C/C++ addons with N-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
13
- for more information on N-API.
22
+ in Node.js core, use Node-API. Refer to
23
+ [C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
24
+ for more information on Node-API.
14
25
 
15
- N-API is an ABI stable C interface provided by Node.js for building native
26
+ Node-API is an ABI stable C interface provided by Node.js for building native
16
27
  addons. It is independent from the underlying JavaScript runtime (e.g. V8 or ChakraCore)
17
28
  and is maintained as part of Node.js itself. It is intended to insulate
18
29
  native addons from changes in the underlying JavaScript engine and allow
@@ -20,24 +31,24 @@ modules compiled for one version to run on later versions of Node.js without
20
31
  recompilation.
21
32
 
22
33
  The `node-addon-api` module, which is not part of Node.js, preserves the benefits
23
- of the N-API as it consists only of inline code that depends only on the stable API
24
- provided by N-API. As such, modules built against one version of Node.js
34
+ of the Node-API as it consists only of inline code that depends only on the stable API
35
+ provided by Node-API. As such, modules built against one version of Node.js
25
36
  using node-addon-api should run without having to be rebuilt with newer versions
26
37
  of Node.js.
27
38
 
28
39
  It is important to remember that *other* Node.js interfaces such as
29
40
  `libuv` (included in a project via `#include <uv.h>`) are not ABI-stable across
30
- Node.js major versions. Thus, an addon must use N-API and/or `node-addon-api`
41
+ Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api`
31
42
  exclusively and build against a version of Node.js that includes an
32
- implementation of N-API (meaning an active LTS version of Node.js) in
43
+ implementation of Node-API (meaning an active LTS version of Node.js) in
33
44
  order to benefit from ABI stability across Node.js major versions. Node.js
34
45
  provides an [ABI stability guide][] containing a detailed explanation of ABI
35
- stability in general, and the N-API ABI stability guarantee in particular.
46
+ stability in general, and the Node-API ABI stability guarantee in particular.
36
47
 
37
- As new APIs are added to N-API, node-addon-api must be updated to provide
48
+ As new APIs are added to Node-API, node-addon-api must be updated to provide
38
49
  wrappers for those new APIs. For this reason node-addon-api provides
39
- methods that allow callers to obtain the underlying N-API handles so
40
- direct calls to N-API and the use of the objects/methods provided by
50
+ methods that allow callers to obtain the underlying Node-API handles so
51
+ direct calls to Node-API and the use of the objects/methods provided by
41
52
  node-addon-api can be used together. For example, in order to be able
42
53
  to use an API for which the node-addon-api does not yet provide a wrapper.
43
54
 
@@ -45,8 +56,8 @@ APIs exposed by node-addon-api are generally used to create and
45
56
  manipulate JavaScript values. Concepts and operations generally map
46
57
  to ideas specified in the **ECMA262 Language Specification**.
47
58
 
48
- The [N-API Resource](https://nodejs.github.io/node-addon-examples/) offers an
49
- excellent orientation and tips for developers just getting started with N-API
59
+ The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an
60
+ excellent orientation and tips for developers just getting started with Node-API
50
61
  and node-addon-api.
51
62
 
52
63
  - **[Setup](#setup)**
@@ -59,7 +70,7 @@ and node-addon-api.
59
70
  - **[Contributors](#contributors)**
60
71
  - **[License](#license)**
61
72
 
62
- ## **Current version: 3.1.0**
73
+ ## **Current version: 3.2.0**
63
74
 
64
75
  (See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
65
76
 
@@ -67,12 +78,12 @@ and node-addon-api.
67
78
 
68
79
  <a name="setup"></a>
69
80
 
70
- node-addon-api is based on [N-API](https://nodejs.org/api/n-api.html) and supports using different N-API versions.
71
- This allows addons built with it to run with Node.js versions which support the targeted N-API version.
81
+ node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions.
82
+ This allows addons built with it to run with Node.js versions which support the targeted Node-API version.
72
83
  **However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that
73
84
  every year there will be a new major which drops support for the Node.js LTS version which has gone out of service.
74
85
 
75
- The oldest Node.js version supported by the current version of node-addon-api is Node.js 10.x.
86
+ The oldest Node.js version supported by the current version of node-addon-api is Node.js 12.x.
76
87
 
77
88
  ## Setup
78
89
  - [Installation and usage](doc/setup.md)
@@ -141,14 +152,14 @@ The following is the documentation for node-addon-api.
141
152
 
142
153
  Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)**
143
154
 
144
- - **[Hello World](https://github.com/nodejs/node-addon-examples/tree/master/1_hello_world/node-addon-api)**
145
- - **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/master/2_function_arguments/node-addon-api)**
146
- - **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/master/3_callbacks/node-addon-api)**
147
- - **[Object factory](https://github.com/nodejs/node-addon-examples/tree/master/4_object_factory/node-addon-api)**
148
- - **[Function factory](https://github.com/nodejs/node-addon-examples/tree/master/5_function_factory/node-addon-api)**
149
- - **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/master/6_object_wrap/node-addon-api)**
150
- - **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/master/7_factory_wrap/node-addon-api)**
151
- - **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/master/8_passing_wrapped/node-addon-api)**
155
+ - **[Hello World](https://github.com/nodejs/node-addon-examples/tree/HEAD/1_hello_world/node-addon-api)**
156
+ - **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/HEAD/2_function_arguments/node-addon-api)**
157
+ - **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/HEAD/3_callbacks/node-addon-api)**
158
+ - **[Object factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/4_object_factory/node-addon-api)**
159
+ - **[Function factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/5_function_factory/node-addon-api)**
160
+ - **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/HEAD/6_object_wrap/node-addon-api)**
161
+ - **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/HEAD/7_factory_wrap/node-addon-api)**
162
+ - **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/HEAD/8_passing_wrapped/node-addon-api)**
152
163
 
153
164
  <a name="tests"></a>
154
165
 
@@ -167,14 +178,14 @@ npm install
167
178
  npm test --disable-deprecated
168
179
  ```
169
180
 
170
- To run the tests targetting a specific version of N-API run
181
+ To run the tests targeting a specific version of Node-API run
171
182
  ```
172
183
  npm install
173
184
  export NAPI_VERSION=X
174
185
  npm test --NAPI_VERSION=X
175
186
  ```
176
187
 
177
- where X is the version of N-API you want to target.
188
+ where X is the version of Node-API you want to target.
178
189
 
179
190
  ### **Debug**
180
191
 
@@ -190,7 +201,7 @@ If you want faster build, you might use the following option:
190
201
  npm run-script dev:incremental
191
202
  ```
192
203
 
193
- Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/master/test)**
204
+ Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)**
194
205
 
195
206
  ### **Benchmarks**
196
207
 
@@ -206,10 +217,11 @@ See [benchmark/README.md](benchmark/README.md) for more details about running an
206
217
 
207
218
  ### **More resource and info about native Addons**
208
219
  - **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)**
209
- - **[N-API](https://nodejs.org/dist/latest/docs/api/n-api.html)**
210
- - **[N-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)**
220
+ - **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)**
221
+ - **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)**
222
+ - **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)**
211
223
 
212
- As node-addon-api's core mission is to expose the plain C N-API as C++
224
+ As node-addon-api's core mission is to expose the plain C Node-API as C++
213
225
  wrappers, tools that facilitate n-api/node-addon-api providing more
214
226
  convenient patterns on developing a Node.js add-ons with n-api/node-addon-api
215
227
  can be published to NPM as standalone packages. It is also recommended to tag
@@ -217,23 +229,31 @@ such packages with `node-addon-api` to provide more visibility to the community.
217
229
 
218
230
  Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api).
219
231
 
232
+ <a name="other-bindings"></a>
233
+
234
+ ### **Other bindings**
235
+
236
+ - **[napi-rs](https://napi.rs)** - (`Rust`)
237
+
220
238
  <a name="badges"></a>
221
239
 
222
240
  ### **Badges**
223
241
 
224
- The use of badges is recommended to indicate the minimum version of N-API
242
+ The use of badges is recommended to indicate the minimum version of Node-API
225
243
  required for the module. This helps to determine which Node.js major versions are
226
- supported. Addon maintainers can consult the [N-API support matrix][] to determine
227
- which Node.js versions provide a given N-API version. The following badges are
244
+ supported. Addon maintainers can consult the [Node-API support matrix][] to determine
245
+ which Node.js versions provide a given Node-API version. The following badges are
228
246
  available:
229
247
 
230
- ![N-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v1%20Badge.svg)
231
- ![N-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v2%20Badge.svg)
232
- ![N-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v3%20Badge.svg)
233
- ![N-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v4%20Badge.svg)
234
- ![N-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v5%20Badge.svg)
235
- ![N-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v6%20Badge.svg)
236
- ![N-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20Experimental%20Version%20Badge.svg)
248
+ ![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg)
249
+ ![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg)
250
+ ![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg)
251
+ ![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg)
252
+ ![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg)
253
+ ![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg)
254
+ ![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg)
255
+ ![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg)
256
+ ![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg)
237
257
 
238
258
  ## **Contributing**
239
259
 
@@ -250,7 +270,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around
250
270
  | Anna Henningsen | [addaleax](https://github.com/addaleax) |
251
271
  | Chengzhong Wu | [legendecas](https://github.com/legendecas) |
252
272
  | Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) |
253
- | Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) |
254
273
  | Jim Schlight | [jschlight](https://github.com/jschlight) |
255
274
  | Michael Dawson | [mhdawson](https://github.com/mhdawson) |
256
275
  | Kevin Eady | [KevinEady](https://github.com/KevinEady)
@@ -262,6 +281,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around
262
281
  | Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) |
263
282
  | Benjamin Byholm | [kkoopa](https://github.com/kkoopa) |
264
283
  | Jason Ginchereau | [jasongin](https://github.com/jasongin) |
284
+ | Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) |
265
285
  | Sampson Gao | [sampsongao](https://github.com/sampsongao) |
266
286
  | Taylor Woll | [boingoing](https://github.com/boingoing) |
267
287
 
@@ -270,4 +290,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around
270
290
  Licensed under [MIT](./LICENSE.md)
271
291
 
272
292
  [ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/
273
- [N-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix
293
+ [Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix
@@ -11,7 +11,7 @@ PropertyDescriptor::Accessor(const char* utf8name,
11
11
  Getter getter,
12
12
  napi_property_attributes attributes,
13
13
  void* /*data*/) {
14
- typedef details::CallbackData<Getter, Napi::Value> CbData;
14
+ using CbData = details::CallbackData<Getter, Napi::Value>;
15
15
  // TODO: Delete when the function is destroyed
16
16
  auto callbackData = new CbData({ getter, nullptr });
17
17
 
@@ -40,7 +40,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name,
40
40
  Getter getter,
41
41
  napi_property_attributes attributes,
42
42
  void* /*data*/) {
43
- typedef details::CallbackData<Getter, Napi::Value> CbData;
43
+ using CbData = details::CallbackData<Getter, Napi::Value>;
44
44
  // TODO: Delete when the function is destroyed
45
45
  auto callbackData = new CbData({ getter, nullptr });
46
46
 
@@ -71,7 +71,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(const char* utf8name,
71
71
  Setter setter,
72
72
  napi_property_attributes attributes,
73
73
  void* /*data*/) {
74
- typedef details::AccessorCallbackData<Getter, Setter> CbData;
74
+ using CbData = details::AccessorCallbackData<Getter, Setter>;
75
75
  // TODO: Delete when the function is destroyed
76
76
  auto callbackData = new CbData({ getter, setter, nullptr });
77
77
 
@@ -102,7 +102,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name,
102
102
  Setter setter,
103
103
  napi_property_attributes attributes,
104
104
  void* /*data*/) {
105
- typedef details::AccessorCallbackData<Getter, Setter> CbData;
105
+ using CbData = details::AccessorCallbackData<Getter, Setter>;
106
106
  // TODO: Delete when the function is destroyed
107
107
  auto callbackData = new CbData({ getter, setter, nullptr });
108
108
 
@@ -133,8 +133,8 @@ inline PropertyDescriptor PropertyDescriptor::Function(const char* utf8name,
133
133
  Callable cb,
134
134
  napi_property_attributes attributes,
135
135
  void* /*data*/) {
136
- typedef decltype(cb(CallbackInfo(nullptr, nullptr))) ReturnType;
137
- typedef details::CallbackData<Callable, ReturnType> CbData;
136
+ using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
137
+ using CbData = details::CallbackData<Callable, ReturnType>;
138
138
  // TODO: Delete when the function is destroyed
139
139
  auto callbackData = new CbData({ cb, nullptr });
140
140
 
@@ -163,8 +163,8 @@ inline PropertyDescriptor PropertyDescriptor::Function(napi_value name,
163
163
  Callable cb,
164
164
  napi_property_attributes attributes,
165
165
  void* /*data*/) {
166
- typedef decltype(cb(CallbackInfo(nullptr, nullptr))) ReturnType;
167
- typedef details::CallbackData<Callable, ReturnType> CbData;
166
+ using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
167
+ using CbData = details::CallbackData<Callable, ReturnType>;
168
168
  // TODO: Delete when the function is destroyed
169
169
  auto callbackData = new CbData({ cb, nullptr });
170
170