forked from kiesel-js/web-runtime
🌐 A web compatible runtime for the Kiesel JavaScript engine
- Zig 100%
| .forgejo/workflows | Initial commit | |
| src | Implement console.assert() | |
| .gitignore | Initial commit | |
| build.zig | Remove pinned kiesel dependency with relative module import | |
| build.zig.zon | Remove pinned kiesel dependency with relative module import | |
| LICENSE | Initial commit | |
| README.md | Implement console.assert() | |
Kiesel Runtime
🌐 A web compatible runtime for the Kiesel JavaScript engine
justforfunnoreally.dev badge License
Introduction
The goal for this project roughly aligns with the WinterCG
Minimum Common Web Platform API.
Kiesel itself only provides an implementation of ECMA-262 and ECMA-402, other
commonly available APIs like console will be implemented here.
Build
This is included in the kiesel CLI by default, follow the instructions in the
main repo.
To include this runtime in your own project using Kiesel for JS evaluation:
-
Add the dependency to your
build.zig.zon -
Supply the
kieselmodule import:constkiesel=b.dependency("kiesel");constkiesel_runtime=b.dependency("kiesel-runtime");kiesel_runtime.module("kiesel-runtime").addImport("kiesel",kiesel.module("kiesel")); -
Add bindings to an object (usually the global object) as follows:
constkiesel_runtime=@import("kiesel-runtime");// ...trykiesel_runtime.addBindings(realm,global_object);
Available APIs
console.assert()console.debug()console.error()console.info()console.log()console.warn()crypto.getRandomValues()crypto.randomUUID()navigator.userAgentperformance.now()performance.timeOriginqueueMicrotask()