Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>WASI based WebAssembly Execution EngineNew to Visual Studio Code? Get it now.
WASI based WebAssembly Execution Engine

WASI based WebAssembly Execution Engine

Microsoft

microsoft.com
|
9,951 installs
| (0) | Free
Executes WebAssemblies compiled to WASI Preview 1 on top of the VS Code API.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

WASM WASI Core Extension

Build Status

This VS Code library extension provides API to run WASM binaries in VS Code's extension host both in the desktop and the Web. The WASM file needs to be created with a WASI Preview 1 compliant tool chain like the WASI-SDK or Rust using the wasm32-wasip1 target.

The library extension supports the following WASI specifications:

  • wasi_snapshot_preview1
  • thread support

Please note that WASI is work in progress. As a result, newer versions of this extension might not be backwards compatible with older WASI standards.

There is also an additional npm module @vscode/wasm-wasi that eases the API access to the extension.

Example

The source code of the example can be found here

First we need to define a package.json for the extension that wants to execute a WASM process:

{
	"name": "...",
	...
	// depend on the wasm-wasi-core extension
	"extensionDependencies": [
		"ms-vscode.wasm-wasi-core"
	],
	// Depend on the wasm-wasi facade npm module to get easier API access to the
	// core extension.
	"dependencies": {
		"@vscode/wasm-wasi": "..."
	},
}

The actual source code to execute a WASM process looks like this

// Load the WASM API
const wasm: Wasm = await Wasm.load();

const pty = wasm.createPseudoterminal();
const terminal = window.createTerminal({ name: 'My Example', pty, isTransient: true });
terminal.show(true);
const module = await WebAssembly.compile(await fs.readFile(...);
const process = await wasm.createProcess('hello', module, { stdio: pty.stdio });
await process.run();
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft