WASI

external class WASI(source)

The WASI class provides the WASI system call API and additional convenience methods for working with WASI-based applications. Each WASI instance represents a distinct environment.

Since

v13.3.0, v12.16.0

Constructors

Link copied to clipboard
constructor(options: WASIOptions = definedExternally)

Properties

Link copied to clipboard

wasiImport is an object that implements the WASI system call API. This object should be passed as the wasi_snapshot_preview1 import during the instantiation of a WebAssembly.Instance.

Functions

Link copied to clipboard

Return an import object that can be passed to WebAssembly.instantiate() if no other WASM imports are needed beyond those provided by WASI.

Link copied to clipboard
fun initialize(instance: Any)

Attempt to initialize instance as a WASI reactor by invoking its _initialize() export, if it is present. If instance contains a _start() export, then an exception is thrown.

Link copied to clipboard
fun start(instance: Any): Double

Attempt to begin execution of instance as a WASI command by invoking its _start() export. If instance does not contain a _start() export, or if instance contains an _initialize() export, then an exception is thrown.