🌐 A web compatible runtime for the Kiesel JavaScript engine
| .forgejo/workflows | ||
| src | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| LICENSE | ||
| README.md | ||
Kiesel Runtime
🌐 A web compatible runtime for the Kiesel JavaScript engine
Introduction
The goal for this project roughly aligns with the WinterTC
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:const kiesel = b.dependency("kiesel"); const kiesel_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:
const kiesel_runtime = @import("kiesel-runtime"); // ... try kiesel_runtime.addBindings(realm, global_object);
Available APIs
Blob()Blob.prototype.arrayBuffer()Blob.prototype.bytes()Blob.prototype.sizeBlob.prototype.text()Blob.prototype.typeconsole.assert()console.debug()console.error()console.info()console.log()console.warn()crypto.getRandomValues()crypto.randomUUID()fetch()(using synchronous networking for now. sue me)navigator.userAgentperformance.now()performance.timeOriginqueueMicrotask()TextDecoder()TextDecoder.prototype.decode()TextDecoder.prototype.encodingTextDecoder.prototype.fatalTextDecoder.prototype.ignoreBOMTextEncoder()TextEncoder.prototype.encode()TextEncoder.prototype.encoding