The JavaScript API covers the various objects available on the global WebAssembly object in the browser. Before we discuss those, we'll start with the methods available on the WebAssembly object, with a brief overview of their intended purposes:
- instantiate() is the primary API for compiling and instantiating WebAssembly code
- instantiateStreaming() performs the same functionality as instantiate(), but it uses streaming to compile and instantiate the module, which eliminates an intermediate step
- compile() only compiles a WebAssembly module, but doesn't instantiate it
- compileStreaming() also only compiles a WebAssembly module, but it uses streaming similar to instantiateStreaming()
- validate() ...