From eb54c54bf5f7c077ec094d27cc1d93cd318bde06 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 20 Jun 2024 19:49:04 +0000 Subject: [PATCH] doc: recommend not using libuv node-api function - update documentation recommend not using the napi_get_uv_event_loop function. It should not be need for most if not all uses cases now that the API is more complete. Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/53521 Reviewed-By: Luigi Pinca Reviewed-By: Chengzhong Wu Reviewed-By: Gabriel Schulhof Reviewed-By: Marco Ippolito --- doc/api/n-api.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 6f4d9b00205e1c..a9387733eb7c66 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -6241,6 +6241,12 @@ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env, * `[in] env`: The environment that the API is invoked under. * `[out] loop`: The current libuv loop instance. +Note: While libuv has been relatively stable over time, it does +not provide an ABI stability guarantee. Use of this function should be avoided. +Its use may result in an addon that does not work across Node.js versions. +[asynchronous-thread-safe-function-calls](https://nodejs.org/docs/latest/api/n-api.html#asynchronous-thread-safe-function-calls) +are an alternative for many use cases. + ## Asynchronous thread-safe function calls JavaScript functions can normally only be called from a native addon's main