1
0
Fork
You've already forked runtime
0
forked from kiesel-js/runtime
🌐 A web compatible runtime for the Kiesel JavaScript engine
  • Zig 100%
2025年02月02日 15:38:50 +01:00
.forgejo/workflows Merge CI workflows 2024年11月05日 02:22:14 +00:00
src Update use of std.posix.clock_gettime() 2025年02月02日 15:38:50 +01:00
.gitignore zig-cache -> .zig-cache 2024年06月01日 18:00:21 +02:00
build.zig Update uses of LazyPath 2024年05月17日 19:35:38 +01:00
build.zig.zon Remove pinned kiesel dependency with relative module import 2024年03月22日 22:08:02 +01:00
LICENSE Initial commit 2024年03月13日 21:17:57 +00:00
README.md Add TextEncoder to README 2024年07月24日 00:34:13 +01:00

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:

  1. Add the dependency to your build.zig.zon

  2. Supply the kiesel module import:

    constkiesel=b.dependency("kiesel");constkiesel_runtime=b.dependency("kiesel-runtime");kiesel_runtime.module("kiesel-runtime").addImport("kiesel",kiesel.module("kiesel"));
  3. Add bindings to an object (usually the global object) as follows:

    constkiesel_runtime=@import("kiesel-runtime");// ...
    trykiesel_runtime.addBindings(realm,global_object);

Available APIs

  • Blob()
  • Blob.prototype.arrayBuffer()
  • Blob.prototype.bytes()
  • Blob.prototype.size
  • Blob.prototype.text()
  • Blob.prototype.type
  • console.assert()
  • console.debug()
  • console.error()
  • console.info()
  • console.log()
  • console.warn()
  • crypto.getRandomValues()
  • crypto.randomUUID()
  • navigator.userAgent
  • performance.now()
  • performance.timeOrigin
  • queueMicrotask()
  • TextDecoder()
  • TextDecoder.prototype.decode()
  • TextDecoder.prototype.encoding
  • TextDecoder.prototype.fatal
  • TextDecoder.prototype.ignoreBOM
  • TextEncoder()
  • TextEncoder.prototype.encode()
  • TextEncoder.prototype.encoding