Class Wasmer

A package from the Wasmer registry.

Example

import { Wasmer } from "@wasmer/sdk";

const pkg = await Wasmer.fromRegistry("wasmer/python");
const instance = await pkg.entrypoint!.run({ args: ["--version"]});
const { ok, code, stdout, stderr } = await instance.wait();

if (ok) {
console.log(`Version:`, stdout);
} else {
throw new Error(`Python exited with ${code}: ${stderr}`);
}

Constructors

Properties

commands: Record<string, Command>

A map containing all commands available to the package (including dependencies).

entrypoint?: Command

The package's entrypoint.

Methods

  • Returns string

  • Returns void

  • Create a WasmerPackage.

    Parameters

    Returns Promise<Wasmer>

  • Delete an app from the registry.

    Parameters

    Returns Promise<void>

  • Deploy an app to the registry.

    Parameters

    Returns Promise<DeployedApp>

  • Load a package from a package file.

    Parameters

    • binary: Uint8Array
    • Optional runtime: Runtime

    Returns Promise<Wasmer>

  • Load a package from the Wasmer registry.

    Parameters

    • specifier: string
    • Optional runtime: Runtime

    Returns Promise<Wasmer>

  • Deploy an app to the registry.

    Returns Promise<undefined | User>

Generated using TypeDoc