From edbe38d52d3816627a827fc0346616e033415255 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 1 Aug 2019 09:51:03 -0400 Subject: [PATCH] doc: mention N-API as recommended approach We've had a few comments that from the doc it might not be clear that N-API is the recommended approach for Addons. As a start, mention N-API early in the non N-API section as the recommended approach unless lower level access is required. PR-URL: https://github.com/nodejs/node/pull/28922 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- doc/api/addons.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/api/addons.md b/doc/api/addons.md index a75d287dce156a..b0bb330d32bbaa 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -8,7 +8,13 @@ can be loaded into Node.js using the [`require()`][require] function, and used just as if they were an ordinary Node.js module. They are used primarily to provide an interface between JavaScript running in Node.js and C/C++ libraries. -At the moment, the method for implementing Addons is rather complicated, +There are three options for implementing Addons: N-API, nan, or direct +use of internal V8, libuv and Node.js libraries. Unless you need direct +access to functionality which is not exposed by N-API, use N-API. +Refer to the section [C/C++ Addons - N-API](n-api.html) +for more information on N-API. + +When not using N-API, implementing Addons is complicated, involving knowledge of several components and APIs: - V8: the C++ library Node.js currently uses to provide the