This is a MoonBit binding to the libuv library.
-
Add this module as a dependency to your MoonBit project.
moon update moon add tonyfettes/uv
-
Import
tonyfettes/uv
package where you need it.{ "import": [ "tonyfettes/uv" ] }
-
Use the
tonyfettes/uv
package in your MoonBit project.fn main { try { let uv = @uv.Loop::new() let options = @uv.ProcessOptions::new( "moon", ["moon", "version"], fn(process, exit_status, term_signal) { println( "Process exited with status \{exit_status} and signal \{term_signal}", ) process.close(() => ()) }, ) let process = uv.spawn(options) println("Launched process with ID \{(process).pid()}") uv.run(Default) uv.stop() uv.close() } catch { error => println("Error: \{error}") } }
The following libuv APIs are not yet implemented in this library:
uv_ref()
- Reference counting for handlesuv_unref()
- Unreference handlesuv_has_ref()
- Check handle reference status
uv_get_osfhandle()
- Get OS handle from file descriptoruv_open_osfhandle()
- Open file descriptor from OS handle