README.md
December 6, 2015 ยท View on GitHub
CUv
A module for libuv in pure Swift applications. This module was built for the use of the Caramel framework.
Installation
First, you must build and install libuv. This package assumes libuv is installed to "/usr", so we'll install it here.
- Clone libuv
- Check out to the tag you want (this build assumes a minimum of
v1.7.5) cd libuvsh autogen.sh./configure --prefix=/usrmake install(withsudoas needed)
Usage
Add this to your Package.swift file:
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/CaramelForSwift/CUv.git", majorVersion: 1)
]
)
Then you can import the module and use libuv functions like so:
import CUv
let loop = uv_default_loop()
uv_run(loop, UV_RUN_DEFAULT)
print("Event loop: \(loop)")
License
Written by Steve Streza.
This package is released into the public domain. Any license provided by libuv are still applicable.