Embed a folder of assets like text, images, or config files directly inside a single Zig executable.
Avoid shipping and managing separate asset files alongside your compiled program.
Read a compressed bundle's files by name and choose exactly when to extract them at runtime.
Keep asset file names out of the optimized build's plain text strings.
| kristoff-it/zig-bundler | romance-dev/speedboost | electricalgorithm/protomq | |
|---|---|---|---|
| Stars | 27 | 27 | 31 |
| Language | Zig | Zig | Zig |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 3/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires a Zig project already set up with build.zig and the zig package manager.
zig-bundler is a small tool for the Zig programming language that lets you compress a folder of asset files and embed them directly inside your compiled program. Instead of shipping extra files alongside your executable, or reading them from disk at startup, all of the files in a chosen directory get packed into a single compressed blob that becomes part of the binary itself. The library maps the structure of that directory into Zig code declarations at build time, so file names are not stored as plain text strings in the optimized build, which keeps the compiled program smaller and a bit more opaque about what it contains. The compressed size and the size after extraction are both known while the program is being compiled, not just at runtime. You choose in your own code when, or whether, to actually decompress the bundled files while the program is running. To use it, you add the package to your project with the standard Zig fetch command, then import it in your build.zig file and point it at an assets folder to create a bundle module. From there you add that module as an import to your executable. In your program's own code, you import the generated bundle, call its extract function with a memory allocator, and then read individual files out of it by name, for example my_bundle.files that has an entry for each original file, plus reported compressed and extracted sizes. The project is still fairly early. Its own roadmap lists things not yet built, including support for more compression algorithms with different size versus speed trade-offs, the ability to iterate over the bundled file tree at runtime instead of only accessing files by name, options to toggle alignment and null terminators, and the ability to compress or decompress individual files rather than the whole bundle at once. For anyone wanting to contribute, the README points to issues labeled as good for newcomers, asks that new features come with a snapshot test, either a new one or a modification to an existing one, and states plainly that contributions written with the help of large language models are not welcome. The README does not state a license for the project.
A Zig library that compresses a folder of asset files and embeds them directly inside your compiled executable, decided at compile time.
Mainly Zig. The stack also includes Zig.
The README does not state a license, so reuse terms are unknown until the repository's license file is checked.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.