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: update doc references from N-API to Node-API #176

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ Implementations of examples are named either after Node.js versions (`node_0.10`
`node_0.12`, etc), or Node.js addon implementation APIs:

- [`nan`](https://github.com/nodejs/nan): C++-based abstraction between Node and direct V8 APIs.
- [`N-API`](https://nodejs.org/api/n-api.html): C-based API guaranteeing [ABI stability](https://nodejs.org/en/docs/guides/abi-stability/) across different node versions as well as JavaScript engines.
- [`node-addon-api`](https://github.com/nodejs/node-addon-api): header-only C++ wrapper classes which simplify the use of the C-based N-API.
- [`Node-API`](https://nodejs.org/api/n-api.html): C-based API guaranteeing [ABI stability](https://nodejs.org/en/docs/guides/abi-stability/) across different node versions as well as JavaScript engines. (Node-API was previously known as N-API.)
- [`node-addon-api`](https://github.com/nodejs/node-addon-api): header-only C++ wrapper classes which simplify the use of the C-based Node-API.

Implementations against unsupported versions of Node.js are provided for
completeness and historical context. They are not maintained.

The examples are primarily maintained for N-API and node-addon-api and as outlined in
The examples are primarily maintained for Node-API and node-addon-api and as outlined in
the Node.js [documentation](https://nodejs.org/dist/latest/docs/api/addons.html),
unless there is a need for direct access to functionality which
is not exposed by N-API, use N-API.
is not exposed by Node-API, use Node-API.

The [N-API Resource](http://nodejs.github.io/node-addon-examples/) offers an
excellent orientation and tips for developers just getting started with N-API
The [Node-API Resource](http://nodejs.github.io/node-addon-examples/) offers an
excellent orientation and tips for developers just getting started with Node-API
and `node-addon-api`.

## Usage
Expand Down
6 changes: 3 additions & 3 deletions a-first-project/node-addon-api/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# N-API A First Project
# Node-API A First Project

This is an example project that accompanies the N-API workshop tutorials
This is an example project that accompanies the Node-API workshop tutorials

A tutorial describing this project can be found at the [N-API Resource](https://napi.inspiredware.com/getting-started/first.html).
A tutorial describing this project can be found at the [Node-API Resource](https://napi.inspiredware.com/getting-started/first.html).

To build and run this program on your system, clone it to your computer and run these two commands inside your clone:

Expand Down
2 changes: 1 addition & 1 deletion async_work_promise/napi/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static napi_value StartWork(napi_env env, napi_callback_info info) {

// Create a string to describe this asynchronous operation.
CHECK(napi_create_string_utf8(env,
"N-API Deferred Promise from Async Work Item",
"Node-API Deferred Promise from Async Work Item",
NAPI_AUTO_LENGTH,
&work_name) == napi_ok);

Expand Down
2 changes: 1 addition & 1 deletion async_work_thread_safe_function/napi/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static napi_value StartThread(napi_env env, napi_callback_info info) {

// Create a string to describe this asynchronous operation.
status = napi_create_string_utf8(env,
"N-API Thread-safe Call from Async Work Item",
"Node-API Thread-safe Call from Async Work Item",
NAPI_AUTO_LENGTH,
&work_name);
assert(status == napi_ok);
Expand Down
10 changes: 5 additions & 5 deletions build_with_cmake/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Building N-API Addons Using CMake.js
## Building Node-API Addons Using CMake.js

### Examples

The objective of these examples is to demonstrate how to build N-API addons using [CMake.js](https://github.com/cmake-js/cmake-js#readme).
The objective of these examples is to demonstrate how to build Node-API addons using [CMake.js](https://github.com/cmake-js/cmake-js#readme).

These example projects assume that CMake.js has been installed globally:

Expand All @@ -22,12 +22,12 @@ Complete CMake.js documentation can be found on the [CMake.js GitHub repository]

### NAPI_VERSION

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

```
add_definitions(-DNAPI_VERSION=3)
```

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

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.
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.
2 changes: 1 addition & 1 deletion build_with_cmake/napi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "build-napi-with-cmake",
"version": "0.0.0",
"description": "Build N-API native addon with CMake.",
"description": "Build Node-API native addon with CMake.",
"main": "hello.js",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion build_with_cmake/node-addon-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB})

# Include N-API wrappers
# Include Node-API wrappers
execute_process(COMMAND node -p "require('node-addon-api').include"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE NODE_ADDON_API_DIR
Expand Down
2 changes: 1 addition & 1 deletion build_with_cmake/node-addon-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "build-node-addon-api-with-cmake",
"version": "0.0.0",
"description": "Build N-API native addon with CMake and node-addon-api C++ wrapper.",
"description": "Build Node-API native addon with CMake and node-addon-api C++ wrapper.",
"main": "hello.js",
"private": true,
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions napi-asyncworker-example/node-addon-api/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# N-API AsyncWorker Example
# Node-API AsyncWorker Example

This is an example project showing how to use the Node.js N-API AsyncWorker class
This is an example project showing how to use the Node.js Node-API AsyncWorker class

A tutorial describing this project can be found at the [N-API Resource](https://napi.inspiredware.com/special-topics/asyncworker.html).
A tutorial describing this project can be found at the [Node-API Resource](https://napi.inspiredware.com/special-topics/asyncworker.html).

To build and run this program on your system, clone it to your computer and run these two commands inside your clone:

Expand Down
2 changes: 1 addition & 1 deletion napi-asyncworker-example/node-addon-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "napi-asyncworker-example",
"description": "An example project showing how to use the Node.js N-API AsyncWorker class",
"description": "An example project showing how to use the Node.js Node-API AsyncWorker class",
"version": "1.0.0",
"main": "test/Test.js",
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions object-wrap-demo/node-addon-api/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# N-API Object Wrap Demo
# Node-API Object Wrap Demo

This is an example project that accompanies the N-API workshop tutorials
This is an example project that accompanies the Node-API workshop tutorials

A tutorial describing this project can be found at the [N-API Resource](https://napi.inspiredware.com/getting-started/objectwrap.html).
A tutorial describing this project can be found at the [Node-API Resource](https://napi.inspiredware.com/getting-started/objectwrap.html).

To build and run this program on your system, clone it to your computer and run these two commands inside your clone:

Expand Down
2 changes: 1 addition & 1 deletion typescript_with_addon/node-addon-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB})

# Include N-API wrappers
# Include Node-API wrappers
execute_process(COMMAND node -p "require('node-addon-api').include"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE NODE_ADDON_API_DIR
Expand Down
6 changes: 3 additions & 3 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# The N-API Resource
# The Node-API Resource

This directory contains the Markdown and supporting files that comprise the N-API Resource website published at the following URL by GitHub Pages:
This directory contains the Markdown and supporting files that comprise the Node-API Resource website published at the following URL by GitHub Pages:

https://nodejs.github.io/node-addon-examples/

The website is generated by [Gatsby](https://www.gatsbyjs.org) and published to this repository's `gh-pages` branch.

## Objective

The basic objective of this site is to publish additional useful information concerning the N-API technology that extends beyond the basic documentation.
The basic objective of this site is to publish additional useful information concerning the Node-API technology that extends beyond the basic documentation.

Ideally, pages published to this site should reference a working demo module that is also stored in this same repository. Features configured into the Gatsby project make embedding example source code fairly straightforward.

Expand Down
8 changes: 4 additions & 4 deletions website/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

module.exports = {
siteMetadata: {
title: 'The N-API Resource',
sidebarTitle: 'N-API Resource',
description: 'Tutorials and more for Node.js N-API.',
title: 'The Node-API Resource',
sidebarTitle: 'Node-API Resource',
description: 'Tutorials and more for Node.js Node-API.',
siteUrl: 'https://github.com/nodejs/node-addon-examples',
keywords: 'node nodejs n-api napi tutorials native-addon',
author: {
name: 'The N-API Team',
name: 'The Node-API Team',
url: 'https://github.com/nodejs/node-addon-examples',
email: ''
}
Expand Down
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "napi-resource",
"description": "Tutorials and more for Node.js N-API.",
"description": "Tutorials and more for Node.js Node-API.",
"version": "1.0.0",
"author": "The N-API Team",
"author": "The Node-API Team",
"keywords": [
"node",
"nodejs",
Expand Down