A WebAssembly.Module object contains stateless WebAssembly code that has already been compiled by the browser and can be efficiently shared with Workers, cached in IndexedDB and instantiated multiple times.

The WebAssembly.Module() constructor function can be called to synchronously compile given WebAssembly binary code. However, the primary way to get a Module is through an asynchronous compilation function like WebAssembly.compile() or by reading a Module out of IndexedDB.

Constructor Syntax

Important: Since compilation for large modules can be expensive, developers should only use the Module() constructor when synchronous compilation is absolutely required; the asynchronous WebAssembly.compile() method should be used at all other times.