Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zigcc/zig-msgpack
zig messagpack implementation / msgpack.org[zig]
https://github.com/zigcc/zig-msgpack
msgpack msgpack-rpc zig zig-package
Last synced: 2 months ago
JSON representation
zig messagpack implementation / msgpack.org[zig]
- Host: GitHub
- URL: https://github.com/zigcc/zig-msgpack
- Owner: zigcc
- License: mit
- Created: 2024-01-07T08:35:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-19T15:00:24.000Z (7 months ago)
- Last Synced: 2024-07-19T17:53:37.090Z (7 months ago)
- Topics: msgpack, msgpack-rpc, zig, zig-package
- Language: Zig
- Homepage: https://ziglang.cc/zig-msgpack/
- Size: 103 KB
- Stars: 19
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MessagePack for Zig
This is an implementation of [MessagePack](https://msgpack.org/index.html) for [Zig](https://ziglang.org/).an article introducing it: [Zig Msgpack](https://nvimer.org/blog/zig-msgpack/)
## Features
- Supports all MessagePack types(except timestamp)
- Efficient encoding and decoding
- Simple and easy-to-use API## NOTE
The current protocol implementation has been completed, but it has not been fully tested.
Only limited unit testing has been conducted, which does not cover everything.## Getting Started
### `0.11`
1. Add to `build.zig.zon`
```zig
.@"zig-msgpack" = .{
// It is recommended to replace the following branch with commit id
.url = "https://github.com/zigcc/zig-msgpack/archive/{commit or branch}.tar.gz",
.hash = ,
},
```2. Config `build.zig`
```zig
const msgpack = b.dependency("zig-msgpack", .{
.target = target,
.optimize = optimize,
});// add module
exe.addModule("msgpack", msgpack.module("msgpack"));
```### `0.12` \ `0.13` \ `nightly`
1. Add to `build.zig.zon`
```sh
zig fetch --save https://github.com/zigcc/zig-msgpack/archive/{commit or branch}.tar.gz
# Of course, you can also use git+https to fetch this package!
```2. Config `build.zig`
```zig
// To standardize development, maybe you should use `lazyDependency()` instead of `dependency()`
const msgpack = b.dependency("zig-msgpack", .{
.target = target,
.optimize = optimize,
});// add module
exe.root_module.addImport("msgpack", msgpack.module("msgpack"));
```## Related projects
- [znvim](https://github.com/jinzhongjia/znvim)