wasmify

Functions

pub fn function(v: a) -> Imports

Converts a function to be accessable in WASM

pub fn get(instance: WebAssemblyInstance, name: String) -> Result(
  a,
  Nil,
)

Get a exported function (if it exists)

pub fn instance(module: WebAssemblyModule, imports: List(Imports)) -> WebAssemblyInstance

Create an Instance and supply imports to be acessed in WebAssembly

pub fn load_wasm(path: String) -> Result(
  Promise(Uint8Array),
  String,
)

Asynchronous load *.wasm as a Uint8Array/Buffer Error can occur if the file does not exist. Should work in all JavaScript runtimes

pub fn load_wasm_sync(path: String) -> Result(Uint8Array, String)

Syncronously load *.wasm as a Uint8Array/Buffer Error can occur if the file does not exist. Only works in Deno, NodeJS (commonjs), and Bun.

pub fn module(content: Uint8Array) -> WebAssemblyModule

Create a WebAssembly Module

pub fn namespace(name: String, o: List(#(String, Imports))) -> Imports
Search Document