napi_get_named_property


napi_status napi_get_named_property(napi_env env,
                                    napi_value object,
                                    const char* utf8Name,
                                    napi_value* result); 
  • [in] env:调用 Node-API 的环境。
  • [in] object:要从中检索属性的对象。
  • [in] utf8Name:要获取的属性名称。
  • [out] result:该属性的价值。

如果 API 成功,则返回 napi_ok

🌐 Returns napi_ok if the API succeeded.

此方法等同于调用 napi_get_property,并使用从传入的 utf8Name 字符串创建的 napi_value

🌐 This method is equivalent to calling napi_get_property with a napi_value created from the string passed in as utf8Name.