progress

thread safe progress bar and spinner library for zig
git clone git://brookjeynes.dev/bjeynes/progress.git
Log | Files | Refs | README | LICENSE

commit 3f717d7ae1f8556289084dfb4d84b6a99c1603b2
parent d4a8d7c15f44514dcd2b5cc2141072dc489aa55b
Author: brookjeynes <me@brookjeynes.dev>
Date:   Wed,  9 Sep 2026 09:21:08 +1000

docs: update README + LICENSE + included files in build.zig.zon

Signed-off-by: brookjeynes <me@brookjeynes.dev>

Diffstat:
MLICENSE | 2+-
MREADME | 70++++++++++++++++++++++++++++++++++++++--------------------------------
Mbuild.zig.zon | 3+++
3 files changed, 42 insertions(+), 33 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Brook Jeynes +Copyright (c) 2026 Brook Jeynes <me@brookjeynes.dev> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README b/README @@ -6,15 +6,21 @@ Thread safe progress bar and spinner library. Installation ------------ -1. Fetch the package - zig fetch --save git+https://github.com/BrookJeynes/progress -2. Add to your build.zig - const progress = b.dependency("progress", .{}).module("progress"); - exe.root_module.addImport("progress", progress); + 1. Fetch the package -This project is built using the latest stable release of Zig at the time of -writing (v0.16.0) + $ zig fetch --save git+https://git.brookjeynes.dev/bjeynes/progress.git + + 2. Add to your build.zig + + const progress = b.dependency("progress", .{}).module("progress"); + exe.root_module.addImport("progress", progress); + + +Dependencies +------------ + +- Zig compiler (>= 0.16.0) Usage @@ -22,35 +28,35 @@ Usage More examples can be found in examples/ -const std = @import("std"); -const ProgressBar = @import("progress").Bar; -const ProgressSpinner = @import("progress").Spinner; + const std = @import("std"); + const ProgressBar = @import("progress").Bar; + const ProgressSpinner = @import("progress").Spinner; -pub fn bar() !void { - const stdout = std.io.getStdOut().writer(); - var pb = ProgressBar.init(10, stdout.any(), .{}); + pub fn bar() !void { + const stdout = std.io.getStdOut().writer(); + var pb = ProgressBar.init(10, stdout.any(), .{}); - while (!pb.isFinished()) { - pb.add(1); - try pb.render(); + while (!pb.isFinished()) { + pb.add(1); + try pb.render(); - std.time.sleep(std.time.ns_per_ms * 150); - } -} + std.time.sleep(std.time.ns_per_ms * 150); + } + } -pub fn spinner() !void { - const stdout = std.io.getStdOut().writer(); - var ps = ProgressSpinner.init(stdout.any(), .{ - .symbols = ProgressSpinner.PredefinedSymbols.default, - }); + pub fn spinner() !void { + const stdout = std.io.getStdOut().writer(); + var ps = ProgressSpinner.init(stdout.any(), .{ + .symbols = ProgressSpinner.PredefinedSymbols.default, + }); - var iterations: usize = 0; - while (!ps.isFinished()) { - iterations += 1; - try ps.render(); + var iterations: usize = 0; + while (!ps.isFinished()) { + iterations += 1; + try ps.render(); - if (iterations == 20) try ps.finish(); + if (iterations == 20) try ps.finish(); - std.time.sleep(std.time.ns_per_ms * 150); - } -} + std.time.sleep(std.time.ns_per_ms * 150); + } + } diff --git a/build.zig.zon b/build.zig.zon @@ -10,5 +10,8 @@ "build.zig", "build.zig.zon", "src", + "LICENSE", + "README", + "CHANGELOG", }, }