Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Asbind announcment article JavaScript snipper
import { AsBind } from "as-bind";
const wasm = fetch("./path-to-my-wasm.wasm");
const asyncTask = async () => {
const asBindInstance = await AsBind.instantiate(wasm);
// You can now use your wasm / asbind instance!
const response = asBindInstance.exports.myExportedFunctionThatTakesAString(
"Hello World!"
console.log(response); // AsBind: Hello World!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment