From bd1d298a8e16e207aeb7e1713eab7045ea3d0930 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 7 Dec 2020 13:54:02 -0500 Subject: [PATCH 1/3] doc: clarify when to use N-API Refs: https://github.com/nodejs/node-addon-api/issues/684 Signed-off-by: Michael Dawson --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index fd0a6cc11..f8dd4c5d2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,14 @@ the use of the C based [N-API](https://nodejs.org/dist/latest/docs/api/n-api.htm provided by Node.js when using C++. It provides a C++ object model and exception handling semantics with low overhead. +There are three options for implementing addons: N-API, nan, or direct +use of internal V8, libuv and Node.js libraries. Unless there is a need for +direct access to functionality which is not exposed by N-API as outline +in [addons.md](https://github.com/nodejs/node/blob/master/doc/api/addons.md#c-addons) +in Node.js core, use N-API. Refer to +[C/C++ addons with N-API](https://github.com/nodejs/node/blob/master/doc/api/n-api.md) +for more information on N-API. + N-API is an ABI stable C interface provided by Node.js for building native addons. It is independent from the underlying JavaScript runtime (e.g. V8 or ChakraCore) and is maintained as part of Node.js itself. It is intended to insulate From a0196313192b84a6fca0c83858800dc0f5045d37 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 8 Dec 2020 09:20:05 -0500 Subject: [PATCH 2/3] squash: address comments --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8dd4c5d2..a1e38b3ca 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ and exception handling semantics with low overhead. There are three options for implementing addons: N-API, nan, or direct use of internal V8, libuv and Node.js libraries. Unless there is a need for direct access to functionality which is not exposed by N-API as outline -in [addons.md](https://github.com/nodejs/node/blob/master/doc/api/addons.md#c-addons) +in [addons.md](https://nodejs.org/dist/latest/docs/api/addons.html) in Node.js core, use N-API. Refer to -[C/C++ addons with N-API](https://github.com/nodejs/node/blob/master/doc/api/n-api.md) +[C/C++ addons with N-API](https://nodejs.org/dist/latest/docs/api/n-api.html) for more information on N-API. N-API is an ABI stable C interface provided by Node.js for building native From e5eb5e14e6727c57fc2df29968ff0d71eb1f433c Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 9 Dec 2020 17:56:23 -0500 Subject: [PATCH 3/3] squash: address coments --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1e38b3ca..86a82d427 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ and exception handling semantics with low overhead. There are three options for implementing addons: N-API, nan, or direct use of internal V8, libuv and Node.js libraries. Unless there is a need for -direct access to functionality which is not exposed by N-API as outline -in [addons.md](https://nodejs.org/dist/latest/docs/api/addons.html) +direct access to functionality which is not exposed by N-API as outlined +in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html) in Node.js core, use N-API. Refer to [C/C++ addons with N-API](https://nodejs.org/dist/latest/docs/api/n-api.html) for more information on N-API.