New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vscode/wasm-wasi

Package Overview
Dependencies
Maintainers
7
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vscode/wasm-wasi

An API facade for the WASM WASI CORE VS Code extension

  • 0.11.0-next.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
107
increased by55.07%
Maintainers
7
Weekly downloads
 
Created
Source

WASM WASI Core API

Build Status

This npm module implements an API facade for the WASM WASI Core VS Code extension.

History

0.11.0

With release version 0.11.0 the implementation details of the WASM support for VS Code has changed. This npm module is now a facade around the wasm-wasi-core VS Code 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.api();

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();

Keywords

FAQs

Package last updated on 15 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc