napi_get_reference_value
functionv1js_native_api.hIf still valid, this API returns the napi_value representing the JavaScript value associated with the napi_ref. Otherwise, result will be NULL.
NAPI_EXTERN napi_status napi_get_reference_value(napi_env env,
napi_ref ref,
napi_value* result);
[in] env: The environment that the API is invoked under.[in] ref: Thenapi_reffor which the corresponding value is being requested.[out] result: Thenapi_valuereferenced by thenapi_ref.
Returns napi_ok if the API succeeded.
If still valid, this API returns the napi_value representing the
JavaScript value associated with the napi_ref. Otherwise, result
will be NULL.