Welcome to zon.zig, your go-to library for reading and writing ZON (Zig Object Notation) files. This library offers an easy way to manage ZON files in your applications.
To start using zon.zig, follow these steps:
Visit the Releases Page: Go to the following link to download the latest version of zon.zig:
Choose Your Version: On the Releases page, find the latest version listed at the top. Each version is clearly labeled.
Download the File: Click on the appropriate file to download it to your computer.
Unzip the File: If the downloaded file is zipped, right-click on the file and select โExtract Allโ to unzip it.
Run the Application: Open the folder containing the unzipped files. Locate the zon.zig executable and double-click it to run the application.
Once you have installed zon.zig, you can start using it to handle ZON files. Here are a few simple examples:
You can read data from a ZON file using the following function:
const std = @import("std");
const zon = @import("zon");
pub fn main() void {
var file = std.fs.openFile("example.zon", .{ .read = true }) catch {
std.debug.print("Could not open file\n", .{});
return;
};
const content = zon.readZon(file) catch {
std.debug.print("Failed to read ZON file\n", .{});
return;
};
std.debug.print("ZON Content: {s}\n", .{content});
}
You can also write data to a ZON file:
const std = @import("std");
const zon = @import("zon");
pub fn main() void {
var file = std.fs.openFile("output.zon", .{ .write = true }) catch {
std.debug.print("Could not create file\n", .{});
return;
};
const content = zon.writeZon(data) catch {
std.debug.print("Failed to write ZON file\n", .{});
return;
};
std.debug.print("Wrote ZON Content: {s}\n", .{content});
}
Once you have completed the installation, itโs time to start using zon.zig. Return to the following link to download the latest version if you havenโt done so yet:
We welcome contributions and feedback. If you would like to help improve zon.zig, feel free to open issues or submit pull requests on our GitHub page.
Thank you for using zon.zig! We hope you find it easy and useful for working with ZON files.