Skip to main content

Interface: WASIOptions

Properties

args?

optional args?: string[]

Command line arguments.


env?

optional env?: Record<string, string>

Environment variables as key-value pairs.


preopens?

optional preopens?: Record<string, string>

Pre-opened directories mapping guest paths to host paths.


returnOnExit?

optional returnOnExit?: boolean

By default, when the WASI application calls proc_exit(), WASI.start returns the exit code rather than terminating the process. Set to false to make the process exit with that code instead.

Default

true

stderr?

optional stderr?: number

The file descriptor used as standard error in the WASI application. On Windows this must be a regular file or standard-stream fd; sockets and pipes are not supported.

Default

2

stdin?

optional stdin?: number

The file descriptor used as standard input in the WASI application. On Windows this must be a regular file or standard-stream fd; sockets and pipes are not supported.

Default

0

stdout?

optional stdout?: number

The file descriptor used as standard output in the WASI application. On Windows this must be a regular file or standard-stream fd; sockets and pipes are not supported.

Default

1

version

version: WASIVersion

Required. The WASI version to use.