Function createPlugin

  • Create a Plugin given a ManifestLike and ExtismPluginOptions.

    Plugins wrap Wasm modules, exposing rich access to exported functions.

    const plugin = await createPlugin(
    { useWasi: true }

    try {
    const result = await'count_vowels', 'hello world');
    const parsed = result.json();

    console.log(parsed); // { count: 3, total: 3, vowels: "aeiouAEIOU" }
    } finally {
    await plugin.close();

    Plugin can run on a background thread when the environment supports it. You can see if the current environment supports background plugins by checking the hasWorkerCapability property of CAPABILITIES.


    Returns Promise<Plugin>

    a promise for a Plugin.

Generated using TypeDoc