Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2017.
* Some parts of this feature may have varying levels of support.
A WebAssembly.Module object contains stateless WebAssembly code that has already been compiled by the browser — this can be efficiently shared with Workers, and instantiated multiple times.
Note: The WebAssembly.Module object is unrelated to the Module object used in Emscripten.
Creates a new Module object.
Given a Module and string, returns a copy of the contents of all custom sections in the module with the given string name.
WebAssembly.Module.exports()Given a Module, returns an array containing descriptions of all the declared exports.
WebAssembly.Module.imports()Given a Module, returns an array containing descriptions of all the declared imports.
The following example compiles the loaded simple.wasm byte code using the WebAssembly.compileStreaming() method and sends the resulting Module instance to a worker using postMessage().
See the index-compile.html source code or view it live.
The worker function wasm_worker.js defines an import object for the module to use. The function then sets up an event handler to receive the module from the main thread. When the module is received, we create an instance from it using the WebAssembly.instantiate() method and invoke an exported function from inside it.
| WebAssembly JavaScript Interface # modules |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 22, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.