__zigar.init() - chung-leong/zigar GitHub Wiki

Return a promise that resolves when WebAssembly code finishes compiling and all Zig functions can be called synchronously.

const std = @import("std");

pub fn hello() void {
    std.debug.print("hello\n", .{});
}
import { __zigar, hello } from './special-exports-example-1.zig';
const { init } = __zigar;
await init();
hello();
hello

Use of this function is only necessary when topLevelAwait is false. For node-zigar, this function is useless. It returns a promise that resolves immediately.


Special exports: __zigar