napi_get_property
napi_status napi_get_property(napi_env env,
napi_value object,
napi_value key,
napi_value* result); -
[in] env:调用 Node-API 调用的环境。¥
[in] env: The environment that the Node-API call is invoked under. -
[in] object:从中检索属性的对象。¥
[in] object: The object from which to retrieve the property. -
[in] key:要检索的属性的名称。¥
[in] key: The name of the property to retrieve. -
[out] result:属性的值。¥
[out] result: The value of the property.
如果 API 成功,则返回 napi_ok。
¥Returns napi_ok if the API succeeded.
此 API 从传入的 Object 中获取请求的属性。
¥This API gets the requested property from the Object passed in.