Class WASIContext

WASIContext

The context in which a WASI binary is executed. This is used for syscalls that get args, environment, use IO and read/write to files. This gives you programmattic access to the environment that the WASI binary is executing in.

Notes:

stdin - string is passed as JavaScript string but encoded to UTF-8, if this ends up longer than maxByteLength it will be truncated.

debug - function injected between wasi and return for debugging

Hierarchy

  • WASIContext

Constructors

Properties

Constructors

Properties

args: string[]
debug?: DebugFn
env: Record<string, string>
fs: WASIFS
isTTY: boolean
stderr: ((err) => void)

Type declaration

    • (err): void
    • Parameters

      • err: string

      Returns void

stdin: ((maxByteLength) => null | string)

Type declaration

    • (maxByteLength): null | string
    • Parameters

      • maxByteLength: number

      Returns null | string

stdout: ((out) => void)

Type declaration

    • (out): void
    • Parameters

      • out: string

      Returns void

Generated using TypeDoc