zig utility library
0

Configure Feed

Select the types of activity you want to include in your feed.

readme.njk
---
title: Zig Utility Library
eleventyExcludeFromCollections: true
permalink: "../readme.md"
permalinkBypassOutputDir: true
---
# 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 be copy and pasted into an existing library or project.

Full documentation is available at: [https://www.goblgobl.com/zul/](https://www.goblgobl.com/zul/).

(This readme is auto-generated from [docs/src/readme.njk](https://github.com/karlseguin/zul/blob/master/docs/src/readme.njk))

## Usage
In your build.zig.zon add a reference to Zul:

```zig
.{
  .name = "my-app",
  .paths = .{""},
  .version = "0.0.0",
  .dependencies = .{
    .zul = .{
      .url = "https://github.com/karlseguin/zul/archive/master.tar.gz",
      .hash = "$INSERT_HASH_HERE"
    },
  },
}
```

To get the hash, run:

```bash
zig fetch https://github.com/karlseguin/zul/archive/master.tar.gz
```

Instead of `master` you can use a specific commit/tag.

Next, in your `build.zig`, you should already have an executable, something like:

```zig
const exe = b.addExecutable(.{
    .name = "my-app",
    .root_source_file = b.path("src/main.zig"),
    .target = target,
    .optimize = optimize,
});
```

Add the following line:

```zig
exe.root_module.addImport("zul", b.dependency("zul", .{}).module("zul"));
```

You can now `const zul = @import("zul");` in your project.

{% for post in collections.sorted %}
{%- set meta = postMeta(post) -%}
## [{{ post.data.title }}](https://www.goblgobl.com/zul{{post.url}})
{{ meta.desc }}

```zig
{{meta.example.raw | safe}}
```

{% endfor %}