Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/getty-zig/json
A (de)serialization library for JSON
https://github.com/getty-zig/json
json serialization zig
Last synced: 12 days ago
JSON representation
A (de)serialization library for JSON
- Host: GitHub
- URL: https://github.com/getty-zig/json
- Owner: getty-zig
- License: mit
- Created: 2021-07-11T12:59:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-24T13:42:17.000Z (6 months ago)
- Last Synced: 2024-08-01T16:43:59.888Z (4 months ago)
- Topics: json, serialization, zig
- Language: Zig
- Homepage: https://getty-zig.github.io/json/
- Size: 22.2 MB
- Stars: 65
- Watchers: 3
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - getty-zig/json
README
## Overview
_Getty JSON_ is a (de)serialization library for the JSON data format.
## Installation
1. Declare Getty JSON as a project dependency with `zig fetch`:
```sh
zig fetch --save git+https://github.com/getty-zig/json.git#
```2. Expose Getty JSON as a module in your project's `build.zig`:
```zig
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});const opts = .{ .target = target, .optimize = optimize }; // 👈
const json_mod = b.dependency("json", opts).module("json"); // 👈const exe = b.addExecutable(.{
.name = "my-project",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("json", json_mod); // 👈// ...
}
```3. Import Getty JSON into your code:
```zig
const json = @import("json");
```