Skip to content

Commit 787e216

Browse files
RaisinTengabrielschulhof
authored andcommitted
doc: rename N-API with Node-API
Done by running: sed -i "s/N-API/Node-API/g" doc/* sed -i "s/N-API/Node-API/g" README.md CONTRIBUTING.md Fixes: #950 PR-URL: #951 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 6280236 commit 787e216

25 files changed

+116
-120
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ contribute to **node-addon-api**:
55
- Source code fixes
66
- Additional tests
77
- Documentation improvements
8-
- Joining the N-API working group and participating in meetings
8+
- Joining the Node-API working group and participating in meetings
99

1010
## Source changes
1111

12-
**node-addon-api** is meant to be a thin convenience wrapper around N-API. With this
13-
in mind, contributions of any new APIs that wrap around a core N-API API will
12+
**node-addon-api** is meant to be a thin convenience wrapper around Node-API. With this
13+
in mind, contributions of any new APIs that wrap around a core Node-API API will
1414
be considered for merge. However, changes that wrap existing **node-addon-api**
1515
APIs are encouraged to instead be provided as an ecosystem module. The
1616
**node-addon-api** team is happy to link to a curated set of modules that build on
@@ -19,7 +19,7 @@ a recommended idiom or pattern.
1919

2020
### Rationale
2121

22-
The N-API team considered a couple different approaches with regards to changes
22+
The Node-API team considered a couple different approaches with regards to changes
2323
extending **node-addon-api**
2424
- Larger core module - Incorporate these helpers and patterns into **node-addon-api**
2525
- Extras package - Create a new package (strawman name '**node-addon-api**-extras')
@@ -35,7 +35,7 @@ encourage folks to make PRs for utility helpers against the same repository.
3535

3636
The downside of the approach is the following:
3737
- Less coherency for our API set
38-
- More maintenance burden on the N-API WG core team.
38+
- More maintenance burden on the Node-API WG core team.
3939

4040
#### Extras Package
4141
This involves us spinning up a new package which contains the utility classes
@@ -48,10 +48,10 @@ The downside of this approach is the following:
4848
community understand where a particular contribution should be directed to (what
4949
belongs in **node-addon-api** vs **node-addon-api-extras**)
5050
- Need to define the level of support/API guarantees
51-
- Unclear if the maintenance burden on the N-API WG is reduced or not
51+
- Unclear if the maintenance burden on the Node-API WG is reduced or not
5252

5353
#### Ecosystem
54-
This doesn't require a ton of up-front work from the N-API WG. Instead of
54+
This doesn't require a ton of up-front work from the Node-API WG. Instead of
5555
accepting utility PRs into **node-addon-api** or creating and maintaining a new
5656
module, the WG will encourage the creation of an ecosystem of modules that
5757
build on top of **node-addon-api**, and provide some level of advertising for these
@@ -61,6 +61,6 @@ etc).
6161
The downside of this approach is the following:
6262
- Potential for lack of visibility - evangelism and education is hard, and module
6363
authors might not find right patterns and instead implement things themselves
64-
- There might be greater friction for the N-API WG in evolving APIs since the
64+
- There might be greater friction for the Node-API WG in evolving APIs since the
6565
ecosystem would have taken dependencies on the API shape of **node-addon-api**
6666

README.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,53 @@ git branch -u origin/main main
1111

1212
# **node-addon-api module**
1313
This module contains **header-only C++ wrapper classes** which simplify
14-
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)
1515
provided by Node.js when using C++. It provides a C++ object model
1616
and exception handling semantics with low overhead.
1717

18-
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
1919
use of internal V8, libuv and Node.js libraries. Unless there is a need for
20-
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
2121
in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html)
22-
in Node.js core, use N-API. Refer to
23-
[C/C++ addons with N-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
24-
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.
2525

26-
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
2727
addons. It is independent from the underlying JavaScript runtime (e.g. V8 or ChakraCore)
2828
and is maintained as part of Node.js itself. It is intended to insulate
2929
native addons from changes in the underlying JavaScript engine and allow
3030
modules compiled for one version to run on later versions of Node.js without
3131
recompilation.
3232

3333
The `node-addon-api` module, which is not part of Node.js, preserves the benefits
34-
of the N-API as it consists only of inline code that depends only on the stable API
35-
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
3636
using node-addon-api should run without having to be rebuilt with newer versions
3737
of Node.js.
3838

3939
It is important to remember that *other* Node.js interfaces such as
4040
`libuv` (included in a project via `#include <uv.h>`) are not ABI-stable across
41-
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`
4242
exclusively and build against a version of Node.js that includes an
43-
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
4444
order to benefit from ABI stability across Node.js major versions. Node.js
4545
provides an [ABI stability guide][] containing a detailed explanation of ABI
46-
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.
4747

48-
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
4949
wrappers for those new APIs. For this reason node-addon-api provides
50-
methods that allow callers to obtain the underlying N-API handles so
51-
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
5252
node-addon-api can be used together. For example, in order to be able
5353
to use an API for which the node-addon-api does not yet provide a wrapper.
5454

5555
APIs exposed by node-addon-api are generally used to create and
5656
manipulate JavaScript values. Concepts and operations generally map
5757
to ideas specified in the **ECMA262 Language Specification**.
5858

59-
The [N-API Resource](https://nodejs.github.io/node-addon-examples/) offers an
60-
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
6161
and node-addon-api.
6262

6363
- **[Setup](#setup)**
@@ -78,8 +78,8 @@ and node-addon-api.
7878

7979
<a name="setup"></a>
8080

81-
node-addon-api is based on [N-API](https://nodejs.org/api/n-api.html) and supports using different N-API versions.
82-
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.
8383
**However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that
8484
every year there will be a new major which drops support for the Node.js LTS version which has gone out of service.
8585

@@ -178,14 +178,14 @@ npm install
178178
npm test --disable-deprecated
179179
```
180180

181-
To run the tests targeting a specific version of N-API run
181+
To run the tests targeting a specific version of Node-API run
182182
```
183183
npm install
184184
export NAPI_VERSION=X
185185
npm test --NAPI_VERSION=X
186186
```
187187

188-
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.
189189

190190
### **Debug**
191191

@@ -217,11 +217,11 @@ See [benchmark/README.md](benchmark/README.md) for more details about running an
217217

218218
### **More resource and info about native Addons**
219219
- **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)**
220-
- **[N-API](https://nodejs.org/dist/latest/docs/api/n-api.html)**
221-
- **[N-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)**
222-
- **[How We Migrated Realm JavaScript From NAN to N-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)**
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)**
223223

224-
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++
225225
wrappers, tools that facilitate n-api/node-addon-api providing more
226226
convenient patterns on developing a Node.js add-ons with n-api/node-addon-api
227227
can be published to NPM as standalone packages. It is also recommended to tag
@@ -233,19 +233,19 @@ Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/sea
233233

234234
### **Badges**
235235

236-
The use of badges is recommended to indicate the minimum version of N-API
236+
The use of badges is recommended to indicate the minimum version of Node-API
237237
required for the module. This helps to determine which Node.js major versions are
238-
supported. Addon maintainers can consult the [N-API support matrix][] to determine
239-
which Node.js versions provide a given N-API version. The following badges are
238+
supported. Addon maintainers can consult the [Node-API support matrix][] to determine
239+
which Node.js versions provide a given Node-API version. The following badges are
240240
available:
241241

242-
![N-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v1%20Badge.svg)
243-
![N-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v2%20Badge.svg)
244-
![N-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v3%20Badge.svg)
245-
![N-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v4%20Badge.svg)
246-
![N-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v5%20Badge.svg)
247-
![N-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20v6%20Badge.svg)
248-
![N-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/N-API%20Experimental%20Version%20Badge.svg)
242+
![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg)
243+
![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg)
244+
![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg)
245+
![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg)
246+
![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg)
247+
![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg)
248+
![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg)
249249

250250
## **Contributing**
251251

@@ -282,4 +282,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around
282282
Licensed under [MIT](./LICENSE.md)
283283

284284
[ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/
285-
[N-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix
285+
[Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix

doc/async_context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Returns the `Napi::Env` environment in which the async context has been created.
6161
Napi::AsyncContext::operator napi_async_context() const;
6262
```
6363

64-
Returns the N-API `napi_async_context` wrapped by the `Napi::AsyncContext`
65-
object. This can be used to mix usage of the C N-API and node-addon-api.
64+
Returns the Node-API `napi_async_context` wrapped by the `Napi::AsyncContext`
65+
object. This can be used to mix usage of the C Node-API and node-addon-api.
6666

6767
## Example
6868

doc/async_worker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ virtual Napi::AsyncWorker::~AsyncWorker();
343343
Napi::AsyncWorker::operator napi_async_work() const;
344344
```
345345

346-
Returns the N-API napi_async_work wrapped by the `Napi::AsyncWorker` object. This
347-
can be used to mix usage of the C N-API and node-addon-api.
346+
Returns the Node-API `napi_async_work` wrapped by the `Napi::AsyncWorker` object. This
347+
can be used to mix usage of the C Node-API and node-addon-api.
348348

349349
## Example
350350

doc/callback_scope.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
There are cases (for example, resolving promises) where it is necessary to have
44
the equivalent of the scope associated with a callback in place when making
5-
certain N-API calls.
5+
certain Node-API calls.
66

77
## Methods
88

@@ -50,5 +50,5 @@ Returns the `Napi::Env` associated with the `Napi::CallbackScope`.
5050
Napi::CallbackScope::operator napi_callback_scope() const;
5151
```
5252

53-
Returns the N-API `napi_callback_scope` wrapped by the `Napi::CallbackScope`
54-
object. This can be used to mix usage of the C N-API and node-addon-api.
53+
Returns the Node-API `napi_callback_scope` wrapped by the `Napi::CallbackScope`
54+
object. This can be used to mix usage of the C Node-API and node-addon-api.

doc/checker-tool.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**node-addon-api** provides a [checker tool][] that will inspect a given
44
directory tree, identifying all Node.js native addons therein, and further
5-
indicating for each addon whether it is an N-API addon.
5+
indicating for each addon whether it is an Node-API addon.
66

77
## To use the checker tool:
88

doc/class_property_descriptor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ inside the `Napi::ObjectWrap<T>` class.
108108
operator napi_property_descriptor&() { return _desc; }
109109
```
110110

111-
Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor`
111+
Returns the original Node-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor`
112112

113113
```cpp
114114
operator const napi_property_descriptor&() const { return _desc; }
115115
```
116116
117-
Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor`
117+
Returns the original Node-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor`

doc/cmake-js.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,37 @@ Your project will require a `CMakeLists.txt` file. The [CMake.js README file](ht
2727

2828
### NAPI_VERSION
2929

30-
When building N-API addons, it's crucial to specify the N-API version your code is designed to work with. With CMake.js, this information is specified in the `CMakeLists.txt` file:
30+
When building Node-API addons, it's crucial to specify the Node-API version your code is designed to work with. With CMake.js, this information is specified in the `CMakeLists.txt` file:
3131

3232
```
3333
add_definitions(-DNAPI_VERSION=3)
3434
```
3535

36-
Since N-API is ABI-stable, your N-API addon will work, without recompilation, with the N-API version you specify in `NAPI_VERSION` and all subsequent N-API versions.
36+
Since Node-API is ABI-stable, your Node-API addon will work, without recompilation, with the Node-API version you specify in `NAPI_VERSION` and all subsequent Node-API versions.
3737

38-
In the absence of a need for features available only in a specific N-API version, version 3 is a good choice as it is the version of N-API that was active when N-API left experimental status.
38+
In the absence of a need for features available only in a specific Node-API version, version 3 is a good choice as it is the version of Node-API that was active when Node-API left experimental status.
3939

4040
### NAPI_EXPERIMENTAL
4141

42-
The following line in the `CMakeLists.txt` file will enable N-API experimental features if your code requires them:
42+
The following line in the `CMakeLists.txt` file will enable Node-API experimental features if your code requires them:
4343

4444
```
4545
add_definitions(-DNAPI_EXPERIMENTAL)
4646
```
4747

4848
### node-addon-api
4949

50-
If your N-API native add-on uses the optional [**node-addon-api**](https://github.com/nodejs/node-addon-api#node-addon-api-module) C++ wrapper, the `CMakeLists.txt` file requires additional configuration information as described on the [CMake.js README file](https://github.com/cmake-js/cmake-js#n-api-and-node-addon-api).
50+
If your Node-API native add-on uses the optional [**node-addon-api**](https://github.com/nodejs/node-addon-api#node-addon-api-module) C++ wrapper, the `CMakeLists.txt` file requires additional configuration information as described on the [CMake.js README file](https://github.com/cmake-js/cmake-js#n-api-and-node-addon-api).
5151

5252
## Example
5353

54-
A working example of an N-API native addon built using CMake.js can be found on the [node-addon-examples repository](https://github.com/nodejs/node-addon-examples/tree/HEAD/build_with_cmake#building-n-api-addons-using-cmakejs).
54+
A working example of an Node-API native addon built using CMake.js can be found on the [node-addon-examples repository](https://github.com/nodejs/node-addon-examples/tree/HEAD/build_with_cmake#building-n-api-addons-using-cmakejs).
5555

5656
## **CMake** Reference
5757

5858
- [Installation](https://github.com/cmake-js/cmake-js#installation)
5959
- [How to use](https://github.com/cmake-js/cmake-js#usage)
60-
- [Using N-API and node-addon-api](https://github.com/cmake-js/cmake-js#n-api-and-node-addon-api)
60+
- [Using Node-API and node-addon-api](https://github.com/cmake-js/cmake-js#n-api-and-node-addon-api)
6161
- [Tutorials](https://github.com/cmake-js/cmake-js#tutorials)
6262
- [Use case in the works - ArrayFire.js](https://github.com/cmake-js/cmake-js#use-case-in-the-works---arrayfirejs)
6363

0 commit comments

Comments
 (0)