Skip to content
napi-bindings

Search

Search pages, projects and the Node-API reference

Browse Node-APIshow

napi_create_reference

functionv1js_native_api.h

This API creates a new reference with the specified reference count to the value passed in.

NAPI_EXTERN napi_status napi_create_reference(napi_env env,
                                              napi_value value,
                                              uint32_t initial_refcount,
                                              napi_ref* result);
  • [in] env: The environment that the API is invoked under.
  • [in] value: The napi_value for which a reference is being created.
  • [in] initial_refcount: Initial reference count for the new reference.
  • [out] result: napi_ref pointing to the new reference.

Returns napi_ok if the API succeeded.

This API creates a new reference with the specified reference count to the value passed in.

View in the official Node.js documentation