Skip to content

init

init(input?): Promise<void>

Loads the base WebAssembly module (fetched next to the package); with { text: true }, the text module too. Idempotent: later calls return at once (or load the text module). Everything else in the package is synchronous and needs this promise to have resolved.

WasmSource | InitOptions

where the base module comes from (a URL, Response, bytes or WebAssembly.Module), or options; omitted, the file next to the package.

Promise<void>

await init(); // or: await init({ text: true })