quickjswasi

package module
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 1 Imported by: 5

README

go-quickjs-wasi-reactor

GoDoc Widget Go Report Card Widget

A Go module that embeds the QuickJS-NG WASI WebAssembly runtime (reactor model).

Variants

This repository provides the reactor model WASM binary for re-entrant execution. If you only need simple blocking execution where QuickJS runs to completion in _start(), see the command model variant above.

About QuickJS-NG

QuickJS is a small and embeddable JavaScript engine. It aims to support the latest ECMAScript specification.

This project uses QuickJS-NG, a community-driven fork of the original QuickJS project by Fabrice Bellard and Charlie Gordon. Both projects are actively maintained. The WASI reactor build target is part of upstream QuickJS-NG, and the WASM binary is pulled directly from QuickJS-NG GitHub release artifacts.

Purpose

This module provides easy access to the QuickJS-NG JavaScript engine compiled to WebAssembly with WASI support using the reactor model. The WASM binary is embedded directly in the Go module, making it easy to use QuickJS in Go applications without external dependencies.

Reactor Model

Unlike the standard WASI "command" model that blocks in _start(), the reactor model exports the raw QuickJS C API functions, enabling full control over the JavaScript runtime lifecycle from the host environment.

The reactor exports the complete QuickJS C API including:

Core Runtime:

  • JS_NewRuntime, JS_FreeRuntime - Runtime lifecycle
  • JS_NewContext, JS_FreeContext - Context lifecycle
  • JS_Eval - Evaluate JavaScript code
  • JS_Call - Call JavaScript functions

Standard Library (quickjs-libc.h):

  • js_init_module_std, js_init_module_os, js_init_module_bjson - Module initialization
  • js_std_init_handlers, js_std_free_handlers - I/O handler setup
  • js_std_add_helpers - Add console.log, print, etc.
  • js_std_loop_once - Run one iteration of the event loop (non-blocking)
  • js_std_poll_io - Poll for I/O events

Memory Management:

  • malloc, free, realloc, calloc - For host to allocate memory

Features

  • Embeds the QuickJS-NG WASI reactor WebAssembly binary
  • Provides version information about the embedded QuickJS release
  • High-level Go API via the wazero-quickjs subpackage
  • Update script to build and copy from local QuickJS checkout

Packages

Root Package (github.com/aperturerobotics/go-quickjs-wasi-reactor)

Provides the embedded WASM binary and version information:

package main

import (
    "fmt"
    quickjswasi "github.com/aperturerobotics/go-quickjs-wasi-reactor"
)

func main() {
    // Access the embedded WASM binary
    wasmBytes := quickjswasi.QuickJSWASM
    fmt.Printf("QuickJS WASM size: %d bytes\n", len(wasmBytes))

    // Get version information
    fmt.Printf("QuickJS version: %s\n", quickjswasi.Version)
    fmt.Printf("Download URL: %s\n", quickjswasi.DownloadURL)
}
Wazero QuickJS Library (github.com/aperturerobotics/go-quickjs-wasi-reactor/wazero-quickjs)

High-level Go API for running JavaScript with wazero:

package main

import (
    "context"
    "embed"
    "os"

    quickjs "github.com/aperturerobotics/go-quickjs-wasi-reactor/wazero-quickjs"
    "github.com/tetratelabs/wazero"
)

//go:embed scripts
var scriptsFS embed.FS

func main() {
    ctx := context.Background()
    r := wazero.NewRuntime(ctx)
    defer r.Close(ctx)

    config := wazero.NewModuleConfig().
        WithStdout(os.Stdout).
        WithStderr(os.Stderr).
        WithFS(scriptsFS)  // Mount embedded filesystem

    qjs, _ := quickjs.NewQuickJS(ctx, r, config)
    defer qjs.Close(ctx)

    // Option 1: Initialize with CLI args to load script via WASI filesystem
    qjs.Init(ctx, []string{"qjs", "--std", "scripts/main.js"})

    // Option 2: Initialize with --std and eval code directly
    // qjs.Init(ctx, []string{"qjs", "--std"})
    // qjs.Eval(ctx, `console.log("Hello from QuickJS!");`, false)

    // Run event loop until idle
    qjs.RunLoop(ctx)
}
Initialization Options
// Basic runtime with std modules available for import
qjs.Init(ctx, nil)
qjs.Eval(ctx, `import * as std from 'qjs:std'; std.printf("Hello\n")`, true)

// With --std flag to expose std, os, bjson as globals
qjs.Init(ctx, []string{"qjs", "--std"})
qjs.Eval(ctx, `std.printf("Hello\n")`, false)  // std is already global

// With script args accessible via scriptArgs global
qjs.Init(ctx, []string{"qjs", "script.js", "--verbose"})
qjs.Eval(ctx, `console.log(scriptArgs)`, false)  // ['qjs', 'script.js', '--verbose']
Non-Blocking Event Loop

The reactor model enables cooperative scheduling with the host:

// Instead of blocking RunLoop(), use LoopOnce() for fine-grained control
for {
    result, err := qjs.LoopOnce(ctx)
    if err != nil {
        return err
    }

    switch {
    case result == quickjs.LoopIdle:
        // No pending work - done
        return nil
    case result == quickjs.LoopError:
        return errors.New("JavaScript error")
    case result == 0:
        // More microtasks pending - continue immediately
        continue
    case result > 0:
        // Timer pending - host can do other work before next iteration
        time.Sleep(time.Duration(result) * time.Millisecond)
    }
}
I/O Polling

For scripts that use os.setReadHandler(), the host must poll for I/O:

// Poll for I/O events (non-blocking)
result, _ := qjs.PollIO(ctx, 0)

// Poll with timeout (blocking up to 100ms)
result, _ := qjs.PollIO(ctx, 100)

See the wazero-quickjs README for more details.

Command-Line REPL

A command-line JavaScript runner with interactive REPL mode is provided:

# Install
go install github.com/aperturerobotics/go-quickjs-wasi-reactor/wazero-quickjs/repl@master

# Interactive REPL
repl

# Run a JavaScript file
repl script.js

# Run as ES module
repl script.mjs --module

Updating

To update to the latest QuickJS-NG reactor build from upstream releases:

# Download latest release automatically
./update-quickjs.bash

# Or specify a release tag
./update-quickjs.bash v0.12.1

This script will:

  1. Fetch the latest release tag from quickjs-ng/quickjs (or use the provided tag)
  2. Download the qjs-wasi-reactor.wasm release artifact
  3. Generate version.go with version and download URL constants

A GitHub Actions workflow (.github/workflows/update-quickjs.yml) also runs daily to automatically check for new upstream releases and publish updated versions.

Building the WASM file from source

To build the WASM file from source:

cd /path/to/quickjs

# Create build directory
mkdir -p build-wasi-reactor && cd build-wasi-reactor

# Configure with WASI SDK
cmake .. \
  -DCMAKE_TOOLCHAIN_FILE=/opt/wasi-sdk/share/cmake/wasi-sdk.cmake \
  -DQJS_WASI_REACTOR=ON \
  -DCMAKE_BUILD_TYPE=Release

# Build
make -j

# Copy output
cp qjs.wasm ../qjs-wasi-reactor.wasm

Testing

go test ./...
cd wazero-quickjs && go test ./...

License

This module is released under the same license as the embedded QuickJS-NG project.

MIT

Documentation

Index

Constants

View Source
const (
	// ExportMalloc allocates memory in WASM linear memory.
	// Signature: malloc(size: i32) -> i32 (pointer)
	ExportMalloc = "malloc"

	// ExportFree frees memory in WASM linear memory.
	// Signature: free(ptr: i32) -> void
	ExportFree = "free"

	// ExportRealloc reallocates memory in WASM linear memory.
	// Signature: realloc(ptr: i32, size: i32) -> i32 (pointer)
	ExportRealloc = "realloc"

	// ExportCalloc allocates zeroed memory in WASM linear memory.
	// Signature: calloc(nmemb: i32, size: i32) -> i32 (pointer)
	ExportCalloc = "calloc"
)

Memory management exports

View Source
const (
	// ExportJSNewRuntime creates a new JavaScript runtime.
	// Signature: JS_NewRuntime() -> i32 (JSRuntime*)
	ExportJSNewRuntime = "JS_NewRuntime"

	// ExportJSFreeRuntime frees a JavaScript runtime.
	// Signature: JS_FreeRuntime(rt: i32) -> void
	ExportJSFreeRuntime = "JS_FreeRuntime"

	// ExportJSNewContext creates a new JavaScript context.
	// Signature: JS_NewContext(rt: i32) -> i32 (JSContext*)
	ExportJSNewContext = "JS_NewContext"

	// ExportJSFreeContext frees a JavaScript context.
	// Signature: JS_FreeContext(ctx: i32) -> void
	ExportJSFreeContext = "JS_FreeContext"

	// ExportJSGetRuntime gets the runtime from a context.
	// Signature: JS_GetRuntime(ctx: i32) -> i32 (JSRuntime*)
	ExportJSGetRuntime = "JS_GetRuntime"

	// ExportJSSetMemoryLimit sets the memory limit for the runtime.
	// Signature: JS_SetMemoryLimit(rt: i32, limit: i64) -> void
	ExportJSSetMemoryLimit = "JS_SetMemoryLimit"

	// ExportJSSetMaxStackSize sets the maximum stack size.
	// Signature: JS_SetMaxStackSize(rt: i32, size: i64) -> void
	ExportJSSetMaxStackSize = "JS_SetMaxStackSize"

	// ExportJSSetGCThreshold sets the GC threshold.
	// Signature: JS_SetGCThreshold(rt: i32, threshold: i64) -> void
	ExportJSSetGCThreshold = "JS_SetGCThreshold"

	// ExportJSRunGC runs garbage collection.
	// Signature: JS_RunGC(rt: i32) -> void
	ExportJSRunGC = "JS_RunGC"
)

Core runtime exports (quickjs.h)

View Source
const (
	// ExportJSEval evaluates JavaScript code.
	// Signature: JS_Eval(ctx: i32, input: i32, input_len: i64, filename: i32, eval_flags: i32) -> i64 (JSValue)
	ExportJSEval = "JS_Eval"

	// ExportJSEvalFunction evaluates a compiled function.
	// Signature: JS_EvalFunction(ctx: i32, fun_obj: i64) -> i64 (JSValue)
	ExportJSEvalFunction = "JS_EvalFunction"

	// ExportJSCall calls a JavaScript function.
	// Signature: JS_Call(ctx: i32, func_obj: i64, this_obj: i64, argc: i32, argv: i32) -> i64 (JSValue)
	ExportJSCall = "JS_Call"
)

Evaluation exports

View Source
const (
	// ExportJSNewStringLen creates a new string from bytes.
	// Signature: JS_NewStringLen(ctx: i32, str: i32, len: i64) -> i64 (JSValue)
	ExportJSNewStringLen = "JS_NewStringLen"

	// ExportJSNewObject creates a new empty object.
	// Signature: JS_NewObject(ctx: i32) -> i64 (JSValue)
	ExportJSNewObject = "JS_NewObject"

	// ExportJSNewArray creates a new array.
	// Signature: JS_NewArray(ctx: i32) -> i64 (JSValue)
	ExportJSNewArray = "JS_NewArray"

	// ExportJSNewArrayBufferCopy creates a new ArrayBuffer with copied data.
	// Signature: JS_NewArrayBufferCopy(ctx: i32, buf: i32, len: i64) -> i64 (JSValue)
	ExportJSNewArrayBufferCopy = "JS_NewArrayBufferCopy"

	// ExportJSToBool converts a value to boolean.
	// Signature: JS_ToBool(ctx: i32, val: i64) -> i32
	ExportJSToBool = "JS_ToBool"

	// ExportJSToInt32 converts a value to int32.
	// Signature: JS_ToInt32(ctx: i32, pres: i32, val: i64) -> i32
	ExportJSToInt32 = "JS_ToInt32"

	// ExportJSToInt64 converts a value to int64.
	// Signature: JS_ToInt64(ctx: i32, pres: i32, val: i64) -> i32
	ExportJSToInt64 = "JS_ToInt64"

	// ExportJSToFloat64 converts a value to float64.
	// Signature: JS_ToFloat64(ctx: i32, pres: i32, val: i64) -> i32
	ExportJSToFloat64 = "JS_ToFloat64"

	// ExportJSToCStringLen2 converts a value to a C string.
	// Signature: JS_ToCStringLen2(ctx: i32, plen: i32, val: i64, cesu8: i32) -> i32 (char*)
	ExportJSToCStringLen2 = "JS_ToCStringLen2"

	// ExportJSFreeCString frees a C string returned by JS_ToCStringLen2.
	// Signature: JS_FreeCString(ctx: i32, ptr: i32) -> void
	ExportJSFreeCString = "JS_FreeCString"

	// ExportJSGetArrayBuffer gets the underlying buffer of an ArrayBuffer.
	// Signature: JS_GetArrayBuffer(ctx: i32, psize: i32, obj: i64) -> i32 (uint8_t*)
	ExportJSGetArrayBuffer = "JS_GetArrayBuffer"

	// ExportJSDupValue duplicates a value (increases refcount).
	// Signature: JS_DupValue(ctx: i32, val: i64) -> i64 (JSValue)
	ExportJSDupValue = "JS_DupValue"

	// ExportJSFreeValue frees a value (decreases refcount).
	// Signature: JS_FreeValue(ctx: i32, val: i64) -> void
	ExportJSFreeValue = "JS_FreeValue"
)

Value exports

View Source
const (
	// ExportJSGetPropertyStr gets a property by string key.
	// Signature: JS_GetPropertyStr(ctx: i32, this_obj: i64, prop: i32) -> i64 (JSValue)
	ExportJSGetPropertyStr = "JS_GetPropertyStr"

	// ExportJSGetPropertyUint32 gets a property by index.
	// Signature: JS_GetPropertyUint32(ctx: i32, this_obj: i64, idx: i32) -> i64 (JSValue)
	ExportJSGetPropertyUint32 = "JS_GetPropertyUint32"

	// ExportJSSetPropertyStr sets a property by string key.
	// Signature: JS_SetPropertyStr(ctx: i32, this_obj: i64, prop: i32, val: i64) -> i32
	ExportJSSetPropertyStr = "JS_SetPropertyStr"

	// ExportJSSetPropertyUint32 sets a property by index.
	// Signature: JS_SetPropertyUint32(ctx: i32, this_obj: i64, idx: i32, val: i64) -> i32
	ExportJSSetPropertyUint32 = "JS_SetPropertyUint32"

	// ExportJSHasProperty checks if an object has a property.
	// Signature: JS_HasProperty(ctx: i32, this_obj: i64, prop: i32) -> i32
	ExportJSHasProperty = "JS_HasProperty"

	// ExportJSDeleteProperty deletes a property.
	// Signature: JS_DeleteProperty(ctx: i32, this_obj: i64, prop: i32, flags: i32) -> i32
	ExportJSDeleteProperty = "JS_DeleteProperty"

	// ExportJSGetGlobalObject gets the global object.
	// Signature: JS_GetGlobalObject(ctx: i32) -> i64 (JSValue)
	ExportJSGetGlobalObject = "JS_GetGlobalObject"
)

Property exports

View Source
const (
	// ExportJSThrow throws an exception.
	// Signature: JS_Throw(ctx: i32, obj: i64) -> i64 (JSValue)
	ExportJSThrow = "JS_Throw"

	// ExportJSGetException gets the current exception.
	// Signature: JS_GetException(ctx: i32) -> i64 (JSValue)
	ExportJSGetException = "JS_GetException"

	// ExportJSHasException checks if there is a pending exception.
	// Signature: JS_HasException(ctx: i32) -> i32
	ExportJSHasException = "JS_HasException"

	// ExportJSIsError checks if a value is an Error object.
	// Signature: JS_IsError(ctx: i32, val: i64) -> i32
	ExportJSIsError = "JS_IsError"
)

Exception exports

View Source
const (
	// ExportJSPromiseState gets the state of a promise.
	// Signature: JS_PromiseState(ctx: i32, promise: i64) -> i32
	ExportJSPromiseState = "JS_PromiseState"

	// ExportJSPromiseResult gets the result of a promise.
	// Signature: JS_PromiseResult(ctx: i32, promise: i64) -> i64 (JSValue)
	ExportJSPromiseResult = "JS_PromiseResult"
)

Promise exports

View Source
const (
	// ExportJSExecutePendingJob executes a pending job.
	// Signature: JS_ExecutePendingJob(rt: i32, pctx: i32) -> i32
	ExportJSExecutePendingJob = "JS_ExecutePendingJob"

	// ExportJSIsJobPending checks if there are pending jobs.
	// Signature: JS_IsJobPending(rt: i32) -> i32
	ExportJSIsJobPending = "JS_IsJobPending"
)

Job exports

View Source
const (
	// ExportJSSetModuleLoaderFunc sets the module loader function.
	// Signature: JS_SetModuleLoaderFunc(rt: i32, normalize: i32, loader: i32, opaque: i32) -> void
	ExportJSSetModuleLoaderFunc = "JS_SetModuleLoaderFunc"

	// ExportJSNewCModule creates a new C module.
	// Signature: JS_NewCModule(ctx: i32, name_str: i32, func: i32) -> i32 (JSModuleDef*)
	ExportJSNewCModule = "JS_NewCModule"

	// ExportJSAddModuleExport adds an export to a module.
	// Signature: JS_AddModuleExport(ctx: i32, m: i32, name_str: i32) -> i32
	ExportJSAddModuleExport = "JS_AddModuleExport"

	// ExportJSSetModuleExport sets an export value.
	// Signature: JS_SetModuleExport(ctx: i32, m: i32, name_str: i32, val: i64) -> i32
	ExportJSSetModuleExport = "JS_SetModuleExport"
)

Module exports

View Source
const (
	// ExportQJSInitArgv initializes the reactor with CLI arguments.
	// Pass same arguments as CLI: e.g. ["qjs", "--std", "script.js"]
	// Supported flags:
	//   --std        Load std, os, bjson modules as globals
	//   -m, --module Treat script as ES module
	//   -e, --eval   Evaluate expression
	//   -I           Include file before script
	// Signature: qjs_init_argv(argc: i32, argv: i32) -> i32
	// Returns: 0 on success, -1 on error
	ExportQJSInitArgv = "qjs_init_argv"

	// ExportQJSGetContext gets the reactor's JSContext.
	// Use with js_std_loop_once, JS_Eval, etc.
	// Signature: qjs_get_context() -> i32 (JSContext*)
	// Returns: JSContext pointer, or NULL if not initialized
	ExportQJSGetContext = "qjs_get_context"

	// ExportQJSDestroy cleans up the reactor runtime.
	// Signature: qjs_destroy() -> void
	ExportQJSDestroy = "qjs_destroy"
)

Reactor mode exports (qjs.c with QJS_WASI_REACTOR) These functions initialize and manage a global QuickJS runtime/context.

View Source
const (
	// ExportJSInitModuleStd initializes the 'std' module.
	// Signature: js_init_module_std(ctx: i32, module_name: i32) -> i32 (JSModuleDef*)
	ExportJSInitModuleStd = "js_init_module_std"

	// ExportJSInitModuleOS initializes the 'os' module.
	// Signature: js_init_module_os(ctx: i32, module_name: i32) -> i32 (JSModuleDef*)
	ExportJSInitModuleOS = "js_init_module_os"

	// ExportJSInitModuleBJSON initializes the 'bjson' module.
	// Signature: js_init_module_bjson(ctx: i32, module_name: i32) -> i32 (JSModuleDef*)
	ExportJSInitModuleBJSON = "js_init_module_bjson"

	// ExportJSStdInitHandlers initializes std handlers.
	// Signature: js_std_init_handlers(rt: i32) -> void
	ExportJSStdInitHandlers = "js_std_init_handlers"

	// ExportJSStdFreeHandlers frees std handlers.
	// Signature: js_std_free_handlers(rt: i32) -> void
	ExportJSStdFreeHandlers = "js_std_free_handlers"

	// ExportJSStdAddHelpers adds std helper functions (console, print, etc).
	// Signature: js_std_add_helpers(ctx: i32, argc: i32, argv: i32) -> void
	ExportJSStdAddHelpers = "js_std_add_helpers"

	// ExportJSStdLoop runs the event loop until no more work.
	// Signature: js_std_loop(ctx: i32) -> i32
	ExportJSStdLoop = "js_std_loop"

	// ExportJSStdLoopOnce runs one iteration of the event loop.
	// Signature: js_std_loop_once(ctx: i32) -> i32
	// Returns:
	//   > 0: Next timer fires in this many milliseconds
	//     0: More work pending; call again immediately
	//    -1: No pending work; event loop is idle
	//    -2: An exception occurred
	ExportJSStdLoopOnce = "js_std_loop_once"

	// ExportJSStdPollIO polls for I/O events.
	// Signature: js_std_poll_io(ctx: i32, timeout_ms: i32) -> i32
	// Parameters:
	//   timeout_ms: 0 = non-blocking, >0 = wait up to N ms, -1 = block
	// Returns:
	//   0: Success (handler invoked or no handlers)
	//   -1: Error
	//   -2: Exception in handler
	ExportJSStdPollIO = "js_std_poll_io"

	// ExportJSStdAwait awaits a promise.
	// Signature: js_std_await(ctx: i32, obj: i64) -> i64 (JSValue)
	ExportJSStdAwait = "js_std_await"

	// ExportJSStdDumpError dumps an error to stderr.
	// Signature: js_std_dump_error(ctx: i32) -> void
	ExportJSStdDumpError = "js_std_dump_error"

	// ExportJSStdEvalBinary evaluates bytecode.
	// Signature: js_std_eval_binary(ctx: i32, buf: i32, buf_len: i64, flags: i32) -> void
	ExportJSStdEvalBinary = "js_std_eval_binary"

	// ExportJSLoadFile loads a file into memory.
	// Signature: js_load_file(ctx: i32, pbuf_len: i32, filename: i32) -> i32 (uint8_t*)
	ExportJSLoadFile = "js_load_file"

	// ExportJSModuleSetImportMeta sets import.meta for a module.
	// Signature: js_module_set_import_meta(ctx: i32, func_val: i64, use_realpath: i32, is_main: i32) -> i32
	ExportJSModuleSetImportMeta = "js_module_set_import_meta"

	// ExportJSModuleLoader is the default module loader function.
	// Signature: js_module_loader(ctx: i32, module_name: i32, opaque: i32) -> i32 (JSModuleDef*)
	ExportJSModuleLoader = "js_module_loader"

	// ExportJSStdPromiseRejectionTracker tracks unhandled promise rejections.
	// Signature: js_std_promise_rejection_tracker(ctx: i32, promise: i64, reason: i64, is_handled: i32, opaque: i32) -> void
	ExportJSStdPromiseRejectionTracker = "js_std_promise_rejection_tracker"
)

Standard library exports (quickjs-libc.h)

View Source
const (
	JSEvalTypeGlobal    = 0 << 0 // global code (default)
	JSEvalTypeModule    = 1 << 0 // module code
	JSEvalFlagStrict    = 1 << 3 // force 'use strict'
	JSEvalFlagCompile   = 1 << 5 // compile only, do not run
	JSEvalFlagBacktrace = 1 << 6 // enable backtrace
)

JS_EVAL_* flags for JS_Eval

View Source
const (
	// LoopResultIdle indicates no pending work (-1)
	LoopResultIdle = -1
	// LoopResultError indicates an error occurred (-2)
	LoopResultError = -2
)

Loop result constants from js_std_loop_once()

View Source
const (
	JSTagFirst         = -11
	JSTagBigDecimal    = -11
	JSTagBigInt        = -10
	JSTagBigFloat      = -9
	JSTagSymbol        = -8
	JSTagString        = -7
	JSTagModule        = -3
	JSTagFunctionByte  = -2
	JSTagObject        = -1
	JSTagInt           = 0
	JSTagBool          = 1
	JSTagNull          = 2
	JSTagUndefined     = 3
	JSTagUninitialized = 4
	JSTagCatchOffset   = 5
	JSTagException     = 6
	JSTagFloat64       = 7
)

JSValue tag constants (matching quickjs.h)

View Source
const (
	// JSValueUndefined is the undefined value
	JSValueUndefined = uint64(JSTagUndefined) << 32
	// JSValueNull is the null value
	JSValueNull = uint64(JSTagNull) << 32
	// JSValueException is the exception value (indicates an exception was thrown)
	JSValueException = uint64(JSTagException) << 32
)

JSValue helpers JSValue is a 64-bit value where: - For tagged values (tag < 0): lower 32 bits = pointer, upper 32 bits = tag - For immediate values (tag >= 0): depends on tag type

View Source
const (
	// Version is the QuickJS-NG reactor version
	Version = "v0.15.1"
	// DownloadURL is the URL where this WASM file was downloaded from
	DownloadURL = "https://github.com/quickjs-ng/quickjs/releases/download/v0.15.1/qjs-wasi-reactor.wasm"
)

QuickJS-NG WASI Reactor version information

View Source
const QuickJSWASMFilename = "qjs-wasi.wasm"

QuickJSWASMFilename is the filename for QuickJSWASM.

Variables

View Source
var QuickJSWASM []byte

QuickJSWASM contains the binary contents of the QuickJS WASI reactor build.

This is a reactor-model WASM that exports the QuickJS C API for re-entrant execution in host environments. Unlike the command model which blocks in _start(), the reactor model allows the host to control execution flow.

The reactor exports the raw QuickJS C API functions from quickjs.h and quickjs-libc.h, allowing full control over runtime lifecycle.

See: https://github.com/quickjs-ng/quickjs

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL