kiesel-js/zig-example
1
3
Fork
You've already forked zig-example
0
Simple example of embedding Kiesel in Zig code
Zig 100%
Linus Groh 3d7a16d4da
All checks were successful
CI / lint (push) Successful in 51s
CI / test (push) Successful in 59s
Add CI
2025年11月23日 17:50:18 +00:00
.forgejo/workflows Add CI 2025年11月23日 17:50:18 +00:00
src Update to Zig 0.15.2 2025年11月23日 17:45:21 +00:00
.gitignore zig-cache -> .zig-cache 2024年06月01日 18:02:04 +02:00
build.zig Update kiesel 2025年06月16日 00:47:24 +02:00
build.zig.zon Update to Zig 0.15.2 2025年11月23日 17:45:21 +00:00
LICENSE Initial commit 2024年01月26日 19:35:11 +00:00
README.md Update kiesel 2025年06月16日 00:47:24 +02:00

Kiesel Zig Example

This repository contains a minimal example of how to embed the Kiesel JS engine in Zig code.

The basic steps are:

  1. Declare dependency in build.zig.zon:

    .{// ...
    .dependencies=.{// ...
    .kiesel=.{.url="https://codeberg.org/kiesel-js/kiesel/archive/<commit hash>.tar.gz",.hash="<package hash>",},},}
  2. Add the module to your executable or library in build.zig:

    constkiesel=b.dependency("kiesel",.{.target=target,.optimize=optimize,// Enabled by default, reduces size if you don't need `Intl` or `Temporal`
    .@"enable-intl"=false,.@"enable-temporal"=false,});// ...
    exe.root_module.addImport("kiesel",kiesel.module("kiesel"));
  3. Use it! See src/main.zig for a basic example, run zig build run to try it out.