Skip to content
uencoder

WASM Module

A WASM Module is the compiled WebAssembly module object holding validated bytecode; it is immutable and can be instantiated multiple times.

Purpose

To represent the compiled, validated unit of WASM code that can be cached and instantiated repeatedly; the core abstraction of WASM.

Mechanism

WebAssembly.compile(bytes)→Promise<Module> or new WebAssembly.Module(bytes) (synchronous). A Module is immutable and can create independent instances via instantiate. It can be passed across contexts with postMessage (sharing the compilation result).

Use cases

  • WASM module management
  • Caching compilation results
  • Cross-context instantiation

Related tools

References