Skip to main content
WASIOptions - wasi - Node documentation
interface WASIOptions

Usage in Deno

import { type WASIOptions } from "node:wasi";
<div class="alert alert-warning"><div><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M12 9v4" /> <path d="M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z" /> <path d="M12 16h.01" /> </svg> Deno compatibility</div><div><p> This symbol is a non-functional stub.</p> </div></div>

Properties

optional
args: string[] | undefined

An array of strings that the WebAssembly application will see as command line arguments. The first argument is the virtual path to the WASI command itself.

optional
env: object | undefined

An object similar to process.env that the WebAssembly application will see as its environment.

optional
preopens: Dict<string> | undefined

This object represents the WebAssembly application's sandbox directory structure. The string keys of preopens are treated as directories within the sandbox. The corresponding values in preopens are the real paths to those directories on the host machine.

optional
returnOnExit: boolean | undefined

By default, when WASI applications call __wasi_proc_exit() wasi.start() will return with the exit code specified rather than terminatng the process. Setting this option to false will cause the Node.js process to exit with the specified exit code instead.

optional
stdin: number | undefined

The file descriptor used as standard input in the WebAssembly application.

optional
stdout: number | undefined

The file descriptor used as standard output in the WebAssembly application.

optional
stderr: number | undefined

The file descriptor used as standard error in the WebAssembly application.

version: "unstable" | "preview1"

The version of WASI requested. Currently the only supported versions are 'unstable' and 'preview1'. This option is mandatory.