1# Node-API Overview 2 3## When to Use 4 5Developed based on the Node.js 8.x LTS [Node-API](https://nodejs.org/docs/latest-v8.x/api/n-api.html), OpenHarmony Node-API allows interaction between ArkTS/JS and C/C++ modules. It provides a set of stable APIs that can be used on different operating systems. 6 7Unless otherwise specified, Node-API in this document refers to OpenHarmony Node-API. 8 9> **NOTE** 10> 11> For details about the differences between OpenHarmony Node-API and Node.js 8.x LTS Node-API, see [Node-API](../reference/native-lib/napi.md). 12 13Generally, ArkTS/JS is used for OpenHarmony application development. However, in compute-intensive scenarios, such as games and physical simulations, the existing C/C++ libraries are required to meet the requirements for performance and efficiency. Node-API encapsulates I/O, CPU-intensive, and OS underlying capabilities and exposes these capabilities in the form of ArkTS/JS interfaces to implement interaction between ArkTS/JS and C/C++ code. Node-API provides the following benefits: 14 15- The system can open rich module functions of the framework layer to upper-layer applications through the ArkTS/JS APIs. 16 17- You can encapsulate core capabilities in C/C++ and use them with ArkTS/JS APIs to improve the execution efficiency of your application. 18 19## Node-API Architecture 20 21**Figure 1** Node-API architecture 22 23 24 25- Native module: a module developed using Node-API and imported to ArkTS. 26 27- Node-API: implements the logic for interaction between ArkTS and C/C++ code. 28 29- ModuleManager: manages native modules, including loading and locating native modules. 30 31- ScopeManager: manages the lifecycle of **napi_value**. 32 33- ReferenceManager: manages the lifecycle of **napi_ref**. 34 35- Native engine: ArkTS engine abstraction layer, which unifies the API behavior of the ArkTS engine at the Node-API layer. 36 37- ArkComiler ArkTS runtime: ArkTS runtime. 38 39## Key Interaction Process of Node-API 40 41**Figure 2** Key interaction process of Node-API 42 43 44 45The interaction between ArkTS and C++ consists of the following two steps: 46 471. Initialization: When a native module is imported to ArkTS, the ArkTS engine calls the ModuleManager to load the .so file and dependencies of the module. When the module is loaded for the first time, the module registration is triggered. Then, the method properties defined by the module are embedded to an **exports** object and the object is returned. 48 492. Invocation: When an ArkTS method is called using the **exports** object, the ArkTS engine locates and calls the embedded C/C++ method. 50