Essential Scala Utilities — Refined for Scala 3 with minimal dependencies.
| Module | Description |
|---|---|
uni |
Core utilities: Design (DI), logging, JSON, MessagePack, Rx, HTTP client, control flow |
uni-test |
Lightweight testing framework with cross-platform support |
uni-netty |
Netty-based HTTP server |
Cross-platform: JVM, Scala.js, and Scala Native.
Add the dependency to your build.sbt (replace <version> with the
version shown in the Maven Central badge above):
libraryDependencies += "org.wvlet.uni" %% "uni" % "<version>"For Scala.js or Scala Native, use %%%:
libraryDependencies += "org.wvlet.uni" %%% "uni" % "<version>"A minimal example using the logging API:
import wvlet.uni.log.LogSupport
class MyService extends LogSupport:
def greet(name: String): String =
info(s"Greeting ${name}")
s"Hello, ${name}!"
@main def hello =
val service = MyService()
println(service.greet("World"))See the reference docs for Design, Rx, JSON/MessagePack, HTTP, and more.
uni-test is a lightweight test framework. Add it as a test
dependency and register the framework:
libraryDependencies += "org.wvlet.uni" %% "uni-test" % "<version>" % Test
testFrameworks += new TestFramework("wvlet.uni.test.Framework")For Scala.js or Scala Native projects, use %%%:
libraryDependencies += "org.wvlet.uni" %%% "uni-test" % "<version>" % TestWrite a test by extending UniTest:
import wvlet.uni.test.UniTest
class MyTest extends UniTest:
test("addition works") {
(1 + 1) shouldBe 2
}Run with sbt test. See the UniTest guide
for assertions, property-based testing, and more.
Apache License 2.0
