Skip to content
@zig-utils

Zig Utilities & More

Commonly-needed, performant & dependency-free Zig utilities.

About zig-utils

Discover a growing collection of fast, dependency-free libraries and tools for Zig. From JavaScript runtimes and web application firewalls to testing, configuration, and release tooling.

Every project is written in pure Zig, has zero external dependencies unless stated otherwise, and is MIT licensed.

  • Runtime and language infrastructure.
  • Security and networking primitives.
  • Text processing and data utilities.
  • Application development tooling.
  • Testing and benchmarking.
  • Automated releases and changelogs.

“Batteries for Zig. Use what you need, compose what you want.”

A few highlights...

Runtime & Engines

  • zig-js - A pure Zig JavaScript engine with WebAssembly, JIT compilation, a JavaScriptCore-shaped C API, and no GIL.
  • zig-gc - A precise tri-color mark-sweep garbage collector with generic embedder bindings and optional compaction.

Security

  • zig-waf - An embeddable web application firewall with OWASP CRS 4 compatibility and integrations for Nginx, Caddy, Envoy, and HAProxy.
  • zig-tls - Pure Zig TLS 1.3 and 1.2 for clients and servers, with non-blocking I/O, STARTTLS, session resumption, and optional 0-RTT.
  • zig-injection - Allocation-free SQL injection and XSS detection compatible with libinjection 4.

Text & Data

  • zig-regex - A regex engine combining a linear-time Thompson NFA with support for lookaround, backreferences, and named groups.
  • zig-xml - A small XML and HTML tokenizer built for untrusted markup, with HTML5 character-reference decoding and no XXE.
  • zig-search-engine - Typed search-engine integrations for Zig services. Typesense first.
  • zig-faker - Reproducible fake data across more than 20 categories and 55 locales.

Application Development

  • zig-cli - Type-safe, compile-time validated command-line interfaces with routing, help output, and interactive prompts.
  • zig-config - A typed configuration loader for files, environment variables, and defaults.
  • zig-error-handling - A zero-overhead Result(T, E) type with mapping, chaining, and pattern matching.

Testing & Benchmarking

  • zig-test-framework - Jest and Vitest-style testing with matchers, mocks, spies, snapshots, coverage, watch mode, and multiple reporters.
  • zig-benchmarks - High-precision benchmarking with percentile statistics and clean terminal output.

Release Tooling

  • zig-bump - Update versions in build.zig.zon, with optional commits, tags, and pushes.
  • zig-changelog - Generate changelogs from conventional commits.
  • zig-starter - A production-ready Zig project template with testing, configuration, benchmarking, and releases included.

Getting started

Most projects can be installed through Pantry or the Zig package manager.

pantry add zig-regex
const regex = b.dependency("regex", .{
    .target = target,
    .optimize = optimize,
});

exe.root_module.addImport("regex", regex.module("regex"));

Refer to each repository for its module name, installation instructions, and minimum Zig version.

Community

  • Discord - Questions, design discussions, and release news.
  • Repositories - Explore every zig-utils project.
  • GitHub Issues - Bug reports, feature requests, and contribution opportunities.

If you are unsure where something belongs, start a discussion in Discord.


More batteries are coming.

Pinned Loading

  1. zig-regex zig-regex Public

    A modern, performant regular expression library for Zig.

    Zig 30 7

  2. zig-js zig-js Public

    A JavaScript engine in pure Zig.

    Zig 25

  3. zig-test-framework zig-test-framework Public

    A modern, feature-rich testing framework for Zig inspired by Jest, Vitest, and Bun's test runner.

    Zig 7

  4. zig-config zig-config Public

    A zero-dependency, smart configuration loader for Zig.

    Zig 6

  5. zig-tls zig-tls Public

    Pure Zig TLS 1.3 & 1.2 implementation and more.

    Zig 3 1

  6. zig-error-handling zig-error-handling Public

    A type-safe error handling library for Zig inspired by Rust's Result<T, E> and TypeScript's neverthrow.

    Zig 3

Repositories

Showing 10 of 18 repositories

Top languages

Loading…

Most used topics

Loading…