1# node-addon-api Documents 2 3* [Setup](#setup) 4* [API Documentation](#api) 5* [Examples](#examples) 6* [ABI Stability Guideline](#abi-stability-guideline) 7* [More resource and info about native Addons](#resources) 8 9Node-API is an ABI stable C interface provided by Node.js for building native 10addons. It is independent of the underlying JavaScript runtime (e.g. or ChakraCore) 11and is maintained as part of Node.js itself. It is intended to insulate 12native addons from changes in the underlying JavaScript engine and allow 13modules compiled for one version to run on later versions of Node.js without 14recompilation. 15 16The `node-addon-api` module, which is not part of Node.js, preserves the benefits 17of the Node-API as it consists only of inline code that depends only on the stable API 18provided by Node-API. As such, modules built against one version of Node.js 19using node-addon-api should run without having to be rebuilt with newer versions 20of Node.js. 21 22## Setup 23 - [Installation and usage](setup.md) 24 - [node-gyp](node-gyp.md) 25 - [cmake-js](cmake-js.md) 26 - [Conversion tool](conversion-tool.md) 27 - [Checker tool](checker-tool.md) 28 - [Generator](generator.md) 29 - [Prebuild tools](prebuild_tools.md) 30 31<a name="api"></a> 32 33## API Documentation 34 35The following is the documentation for node-addon-api. 36 37 - [Full Class Hierarchy](hierarchy.md) 38 - [Addon Structure](addon.md) 39 - Data Types: 40 - [Env](env.md) 41 - [CallbackInfo](callbackinfo.md) 42 - [Reference](reference.md) 43 - [Value](value.md) 44 - [Name](name.md) 45 - [Symbol](symbol.md) 46 - [String](string.md) 47 - [Number](number.md) 48 - [Date](date.md) 49 - [BigInt](bigint.md) 50 - [Boolean](boolean.md) 51 - [External](external.md) 52 - [Object](object.md) 53 - [Array](array.md) 54 - [ObjectReference](object_reference.md) 55 - [PropertyDescriptor](property_descriptor.md) 56 - [Function](function.md) 57 - [FunctionReference](function_reference.md) 58 - [ObjectWrap](object_wrap.md) 59 - [ClassPropertyDescriptor](class_property_descriptor.md) 60 - [Buffer](buffer.md) 61 - [ArrayBuffer](array_buffer.md) 62 - [TypedArray](typed_array.md) 63 - [TypedArrayOf](typed_array_of.md) 64 - [DataView](dataview.md) 65 - [Error Handling](error_handling.md) 66 - [Error](error.md) 67 - [TypeError](type_error.md) 68 - [RangeError](range_error.md) 69 - [SyntaxError](syntax_error.md) 70 - [Object Lifetime Management](object_lifetime_management.md) 71 - [HandleScope](handle_scope.md) 72 - [EscapableHandleScope](escapable_handle_scope.md) 73 - [Memory Management](memory_management.md) 74 - [Async Operations](async_operations.md) 75 - [AsyncWorker](async_worker.md) 76 - [AsyncContext](async_context.md) 77 - [AsyncWorker Variants](async_worker_variants.md) 78 - [Thread-safe Functions](threadsafe.md) 79 - [ThreadSafeFunction](threadsafe_function.md) 80 - [TypedThreadSafeFunction](typed_threadsafe_function.md) 81 - [Promises](promises.md) 82 - [Version management](version_management.md) 83 84<a name="examples"></a> 85 86## Examples 87 88Are you new to **node-addon-api**? Take a look at our **[examples]()** 89 90- [Hello World](/tree/main/src/1-getting-started/1_hello_world) 91- [Pass arguments to a function](/tree/main/src/1-getting-started/2_function_arguments/node-addon-api) 92- [Callbacks](/tree/main/src/1-getting-started/3_callbacks/node-addon-api) 93- [Object factory](/tree/main/src/1-getting-started/4_object_factory/node-addon-api) 94- [Function factory](/tree/main/src/1-getting-started/5_function_factory/node-addon-api) 95- [Wrapping C++ Object](/tree/main/src/1-getting-started/6_object_wrap/node-addon-api) 96- [Factory of wrapped object](/tree/main/src/1-getting-started/7_factory_wrap/node-addon-api) 97- [Passing wrapped object around](/tree/main/src/2-js-to-native-conversion/8_passing_wrapped/node-addon-api) 98 99<a name="abi-stability-guideline"></a> 100 101## ABI Stability Guideline 102 103It is important to remember that *other* Node.js interfaces such as 104`libuv` (included in a project via `#include <uv.h>`) are not ABI-stable across 105Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api` 106exclusively and build against a version of Node.js that includes an 107implementation of Node-API (meaning an active LTS version of Node.js) in 108order to benefit from ABI stability across Node.js major versions. Node.js 109provides an [ABI stability guide][] containing a detailed explanation of ABI 110stability in general, and the Node-API ABI stability guarantee in particular. 111 112<a name="resources"></a> 113 114## More resource and info about native Addons 115 116There are three options for implementing addons: Node-API, nan, or direct 117use of internal , libuv, and Node.js libraries. Unless there is a need for 118direct access to functionality that is not exposed by Node-API as outlined 119in [C/C++ addons](/dist/latest/docs/api/addons.html) 120in Node.js core, use Node-API. Refer to 121[C/C++ addons with Node-API](/dist/latest/docs/api/n-api.html) 122for more information on Node-API. 123 124- [C++ Addons](/dist/latest/docs/api/addons.html) 125- [Node-API](/dist/latest/docs/api/n-api.html) 126- [Node-API - Next Generation Node API for Native Modules]() 127- [How We Migrated Realm JavaScript From NAN to Node-API](/article/realm-javascript-nan-to-n-api) 128 129As node-addon-api's core mission is to expose the plain C Node-API as C++ 130wrappers, tools that facilitate n-api/node-addon-api providing more 131convenient patterns for developing a Node.js add-on with n-api/node-addon-api 132can be published to NPM as standalone packages. It is also recommended to tag 133such packages with `node-addon-api` to provide more visibility to the community. 134 135Quick links to NPM searches: [keywords:node-addon-api](/search?q=keywords%3Anode-addon-api). 136 137<a name="other-bindings"></a> 138 139## Other bindings 140 141[ABI stability guide]: /en/docs/guides/abi-stability/ 142