Skip to content

Commit e8b4753

Browse files
committed
Update README.md
1 parent eb6efd7 commit e8b4753

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,52 @@ This is an implementation of [MessagePack](https://msgpack.org/index.html) for [
1313
The current protocol implementation has been completed, but it has not been fully tested.
1414
Only limited unit testing has been conducted, which does not cover everything.
1515

16+
## Getting Started
17+
18+
### `0.11`
19+
20+
1. Add to `build.zig.zon`
21+
22+
```zig
23+
.@"zig-msgpack" = .{
24+
// It is recommended to replace the following branch with commit id
25+
.url = "https://github.com/zigcc/zig-msgpack/archive/{commit or branch}.tar.gz",
26+
.hash = <hash value>,
27+
},
28+
```
29+
30+
2. Config `build.zig`
31+
32+
```zig
33+
const msgpack = b.dependency("zig-msgpack", .{
34+
.target = target,
35+
.optimize = optimize,
36+
});
37+
38+
// add module
39+
exe.addModule("msgpack", msgpack.module("msgpack"));
40+
```
41+
42+
### `nightly`
43+
44+
1. Add to `build.zig.zon`
45+
46+
```sh
47+
zig fetch --save https://github.com/zigcc/zig-msgpack/archive/{commit or branch}.tar.gz
48+
```
49+
50+
2. Config `build.zig`
51+
52+
```zig
53+
const msgpack = b.dependency("zig-msgpack", .{
54+
.target = target,
55+
.optimize = optimize,
56+
});
57+
58+
// add module
59+
exe.root_module.addImport("msgpack", msgpack.module("msgpack"));
60+
```
61+
1662
## Related projects
1763

1864
- [znvim](https://github.com/jinzhongjia/znvim)

0 commit comments

Comments
 (0)