Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.shared_globals.d.ts>WebAssembly.instantiate

A modern runtime for JavaScript and TypeScript.
Latest
function WebAssembly.instantiate
import { WebAssembly } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.shared_globals.d.ts";
const { instantiate } = WebAssembly;

The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code.

This overload takes the WebAssembly binary code, in the form of a typed array or ArrayBuffer, and performs both compilation and instantiation in one step. The returned Promise resolves to both a compiled WebAssembly.Module and its first WebAssembly.Instance.

MDN

Parameters

optional
importObject: Imports

The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code.

This overload takes an already-compiled WebAssembly.Module and returns a Promise that resolves to an Instance of that Module. This overload is useful if the Module has already been compiled.

MDN

Parameters

moduleObject: Module
optional
importObject: Imports