kiesel-js/zig-example
Simple example of embedding Kiesel in Zig code
| .forgejo/workflows | Add CI | |
| src | Update to Zig 0.15.2 | |
| .gitignore | zig-cache -> .zig-cache | |
| build.zig | Update kiesel | |
| build.zig.zon | Update to Zig 0.15.2 | |
| LICENSE | Initial commit | |
| README.md | Update kiesel | |
Kiesel Zig Example
This repository contains a minimal example of how to embed the Kiesel JS engine in Zig code.
The basic steps are:
-
Declare dependency in
build.zig.zon:.{// ... .dependencies=.{// ... .kiesel=.{.url="https://codeberg.org/kiesel-js/kiesel/archive/<commit hash>.tar.gz",.hash="<package hash>",},},} -
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")); -
Use it! See
src/main.zigfor a basic example, runzig build runto try it out.