Zig Utility Library

The purpose of this library is to enhance Zig's standard library. Much of zul wraps Zig's std to provide simpler APIs for common tasks (e.g. reading lines from a file). In other cases, new functionality has been added (e.g. a UUID type).

Besides Zig's standard library, there are no dependencies. Most functionality is contained within its own file and can easily be copy and pasted into an existing library or project.

zul.benchmark.run

Simple benchmarking function.

example docs
zul.CommandLineArgs

A simple command line parser.

example docs
zul.DateTime

Simple (no leap seconds, UTC-only), DateTime, Date and Time types.

example docs
zul.fs.readDir

Iterates, non-recursively, through a directory.

example docs
zul.fs.readJson

Reads and parses a JSON file.

example docs
zul.fs.readLines

Iterate over the lines in a file.

example docs
zul.http.Client

A wrapper around std.http.Client to make it easier to create requests and consume responses.

example docs
zul.JsonString

Allows the embedding of already-encoded JSON strings into objects in order to avoid double encoded values.

example docs
zul.pool

A thread-safe object pool which will dynamically grow when empty and revert to the configured size.

example docs
zul.Scheduler

Ephemeral thread-based task scheduler used to run tasks at a specific time.

example docs
zul.sort

Helpers for sorting strings and integers

example docs
zul.StringBuilder

Efficiently create/concat strings or binary data, optionally using a thread-safe pool with pre-allocated static buffers.

example docs
zul.testing

Helpers for writing tests.

example docs
zul.ThreadPool

Lightweight thread pool with back-pressure and zero allocations after initialization.

example docs
zul.UUID

Parse and generate version 4 and version 7 UUIDs.

example docs