From 4d2e86d342364b330aad40c9e31737c94d1f1abd Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Fri, 3 Mar 2023 10:52:05 +0800 Subject: [PATCH] fixed f6b5ec3 from https://gitee.com/Annie_wang/docs/pulls/15447 update docs Signed-off-by: Annie_wang --- en/application-dev/napi/napi-guidelines.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/en/application-dev/napi/napi-guidelines.md b/en/application-dev/napi/napi-guidelines.md index 5113c413d5..4448869d84 100644 --- a/en/application-dev/napi/napi-guidelines.md +++ b/en/application-dev/napi/napi-guidelines.md @@ -4,9 +4,7 @@ OpenHarmony applications use JavaScript (JS) when calling native APIs. The nativ ## How to Develop -The DevEco Studio has a default project that uses NAPIs. - -You can choose **File** > **New** > **Create Project** to create a **Native C++** project. The **cpp** directory is generated in the **main** directory. You can use the NAPIs provided by the **ace_napi** repository for development. +The DevEco Studio has a default project that uses NAPIs. You can choose **File** > **New** > **Create Project** to create a **Native C++** project. The **cpp** directory is generated in the **main** directory. You can use the NAPIs provided by the **ace_napi** repository for development. You can import the native .so that contains the JS processing logic. For example, **import hello from 'libhello.so'** to use the **libhello.so** capability. Then, the JS object created using the NAPI can be passed to the **hello** object of the application to call the native capability. @@ -19,7 +17,10 @@ You can import the native .so that contains the JS processing logic. For example ### .so Naming Rules -Each module has a .so file. For example, if the module name is **hello**, name the .so file **libhello.so**. The **nm_modname** field in **napi_module** must be **hello**, which is the same as the module name. The sample code for importing the .so file is **import hello from 'libhello.so'**. +The .so file names must comply with the following rules: + +* Each module has a .so file. +* The **nm_modname** field in **napi_module** must be the same as the module name. For example, if the module name is **hello**, name the .so file **libhello.so**. The sample code for importing the .so file is **import hello from 'libhello.so'**. ### JS Objects and Threads -- GitLab