IssueRaiser

Implement libuv functions

Some NAPI modules use functions from Node.js's internal library `libuv`. Bun doesn't use `libuv` on POSIX systems, so we must polyfill these functions ourselves. ## `libuv` functions (This is not a comprehensive list, feel free to reply below if you are blocked by a missing function) - [ ] `uv_backend_timeout` - [ ] `uv_check_init` - [ ] `uv_check_start` - [ ] `uv_check_stop` - [ ] `uv_close` - [ ] `uv_default_loop` - [ ] `uv_getrusage` - [ ] `uv_hrtime` - [ ] `uv_mutex_destroy` - [ ] `uv_mutex_init` - [ ] `uv_mutex_lock` - [ ] `uv_mutex_trylock` - [ ] `uv_mutex_unlock` - [ ] `uv_once` - [x] `uv_os_getpid` - [x] `uv_os_getppid` - [ ] `uv_prepare_int` - [ ] `uv_prepare_start` - [ ] `uv_prepare_stop` - [ ] `uv_timer_init` - [x] `uv_tty_reset_mode` - [ ] `uv_unref` ## Known NPM packages which depend on unsupported `libuv` functions **Feel free to comment below if there is a package/function we missed** ### `dd-trace` By itself, `dd-trace` won't use any `uv_*` functions but initializing `dd-trace` with the `runtimeMetrics` option set to `true` will use the [@datadog/native-metrics](https://github.com/DataDog/dd-native-metrics-js) module: ```js const tracer = require('dd-trace').init({ runtimeMetrics: true // <-- here }); ``` This depends on the following functions: - [ ] `uv_backend_timeout` - [ ] `uv_check_init` - [ ] `uv_check_start` - [ ] `uv_check_stop` - [ ] `uv_close` - [ ] `uv_getrusage` - [ ] `uv_hrtime` - [ ] `uv_prepare_init` - [ ] `uv_prepare_start` - [ ]

Posted by zackradisic on Mar 27, 2025, 9:05 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

github (Software)

Implement libuv functions

zackradisicMar 27, 2025, 9:05 PM

Some NAPI modules use functions from Node.js's internal library `libuv`. Bun doesn't use `libuv` on POSIX systems, so we must polyfill these functions ourselves. ## `libuv` functions (This is not a comprehensive list, feel free to reply below if you are blocked by a missing function) - [ ] `uv_backend_timeout` - [ ] `uv_check_init` - [ ] `uv_check_start` - [ ] `uv_check_stop` - [ ] `uv_close` - [ ] `uv_default_loop` - [ ] `uv_getrusage` - [ ] `uv_hrtime` - [ ] `uv_mutex_destroy` - [ ] `uv_mutex_init` - [ ] `uv_mutex_lock` - [ ] `uv_mutex_trylock` - [ ] `uv_mutex_unlock` - [ ] `uv_once` - [x] `uv_os_getpid` - [x] `uv_os_getppid` - [ ] `uv_prepare_int` - [ ] `uv_prepare_start` - [ ] `uv_prepare_stop` - [ ] `uv_timer_init` - [x] `uv_tty_reset_mode` - [ ] `uv_unref` ## Known NPM packages which depend on unsupported `libuv` functions **Feel free to comment below if there is a package/function we missed** ### `dd-trace` By itself, `dd-trace` won't use any `uv_*` functions but initializing `dd-trace` with the `runtimeMetrics` option set to `true` will use the [@datadog/native-metrics](https://github.com/DataDog/dd-native-metrics-js) module: ```js const tracer = require('dd-trace').init({ runtimeMetrics: true // <-- here }); ``` This depends on the following functions: - [ ] `uv_backend_timeout` - [ ] `uv_check_init` - [ ] `uv_check_start` - [ ] `uv_check_stop` - [ ] `uv_close` - [ ] `uv_getrusage` - [ ] `uv_hrtime` - [ ] `uv_prepare_init` - [ ] `uv_prepare_start` - [ ]

Comments (0)

No comments yet. Start the discussion.

Comment on this issue