• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Node-API
2
3## Introduction
4
5Node-API provides APIs to encapsulate JavaScript capabilities as a native plug-in. It is independent of the underlying JavaScript and is maintained as part of Node.js.
6
7
8## Supported Capabilities
9
10Node-API eliminates the differences between underlying JavaScript engines and provides a set of stable interfaces.
11
12The OpenHarmony Native API (NAPI) component optimizes the Node-API interface implementation and provides connection to underlying engines such as ArkJS. Currently, some APIs in the [Node-API](https://nodejs.org/docs/v14.9.0/api/n-api.html) standard library are supported.
13
14## Extended Symbols of NAPI
15
16|Type|Symbol|Remarks|
17| --- | --- | --- |
18|FUNC|napi_run_script_path|Runs a JavaScript file.|
19
20**Symbols Exported from the Standard Library**
21
22|Type|Symbol|Remarks|
23| --- | --- | --- |
24|FUNC|napi_module_register||
25|FUNC|napi_get_last_error_info||
26|FUNC|napi_throw||
27|FUNC|napi_throw_error||
28|FUNC|napi_throw_type_error||
29|FUNC|napi_throw_range_error||
30|FUNC|napi_is_error||
31|FUNC|napi_create_error||
32|FUNC|napi_create_type_error||
33|FUNC|napi_create_range_error||
34|FUNC|napi_get_and_clear_last_exception||
35|FUNC|napi_is_exception_pending||
36|FUNC|napi_fatal_error||
37|FUNC|napi_open_handle_scope||
38|FUNC|napi_close_handle_scope||
39|FUNC|napi_open_escapable_handle_scope||
40|FUNC|napi_close_escapable_handle_scope||
41|FUNC|napi_escape_handle||
42|FUNC|napi_create_reference||
43|FUNC|napi_delete_reference||
44|FUNC|napi_reference_ref||
45|FUNC|napi_reference_unref||
46|FUNC|napi_get_reference_value||
47|FUNC|napi_create_array||
48|FUNC|napi_create_array_with_length||
49|FUNC|napi_create_arraybuffer||
50|FUNC|napi_create_external||
51|FUNC|napi_create_external_arraybuffer||
52|FUNC|napi_create_object||
53|FUNC|napi_create_symbol||
54|FUNC|napi_create_typedarray||
55|FUNC|napi_create_dataview||
56|FUNC|napi_create_int32||
57|FUNC|napi_create_uint32||
58|FUNC|napi_create_int64||
59|FUNC|napi_create_double||
60|FUNC|napi_create_string_latin1||
61|FUNC|napi_create_string_utf8||
62|FUNC|napi_get_array_length||
63|FUNC|napi_get_arraybuffer_info||
64|FUNC|napi_get_prototype||
65|FUNC|napi_get_typedarray_info||
66|FUNC|napi_get_dataview_info||
67|FUNC|napi_get_value_bool||
68|FUNC|napi_get_value_double||
69|FUNC|napi_get_value_external||
70|FUNC|napi_get_value_int32||
71|FUNC|napi_get_value_int64||
72|FUNC|napi_get_value_string_latin1||
73|FUNC|napi_get_value_string_utf8||
74|FUNC|napi_get_value_uint32||
75|FUNC|napi_get_boolean||
76|FUNC|napi_get_global||
77|FUNC|napi_get_null||
78|FUNC|napi_get_undefined||
79|FUNC|napi_coerce_to_bool||
80|FUNC|napi_coerce_to_number||
81|FUNC|napi_coerce_to_object||
82|FUNC|napi_coerce_to_string||
83|FUNC|napi_typeof||
84|FUNC|napi_instanceof||
85|FUNC|napi_is_array||
86|FUNC|napi_is_arraybuffer||
87|FUNC|napi_is_typedarray||
88|FUNC|napi_is_dataview||
89|FUNC|napi_is_date||
90|FUNC|napi_strict_equals||
91|FUNC|napi_get_property_names||
92|FUNC|napi_set_property||
93|FUNC|napi_get_property||
94|FUNC|napi_has_property||
95|FUNC|napi_delete_property||
96|FUNC|napi_has_own_property||
97|FUNC|napi_set_named_property||
98|FUNC|napi_get_named_property||
99|FUNC|napi_has_named_property||
100|FUNC|napi_set_element||
101|FUNC|napi_get_element||
102|FUNC|napi_has_element||
103|FUNC|napi_delete_element||
104|FUNC|napi_define_properties||
105|FUNC|napi_call_function||
106|FUNC|napi_create_function||
107|FUNC|napi_get_cb_info||
108|FUNC|napi_get_new_target||
109|FUNC|napi_new_instance||
110|FUNC|napi_define_class||
111|FUNC|napi_wrap||
112|FUNC|napi_unwrap||
113|FUNC|napi_remove_wrap||
114|FUNC|napi_create_async_work||
115|FUNC|napi_delete_async_work||
116|FUNC|napi_queue_async_work||
117|FUNC|napi_cancel_async_work||
118|FUNC|napi_get_node_version||
119|FUNC|napi_get_version||
120|FUNC|napi_create_promise||
121|FUNC|napi_resolve_deferred||
122|FUNC|napi_reject_deferred||
123|FUNC|napi_is_promise||
124|FUNC|napi_run_script||
125|FUNC|napi_get_uv_event_loop||