Skip to main content

@extism/extism@2.0.0-rc3
Built and signed on GitHub Actions

It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
Published
6 months ago (2.0.0-rc3)
class CurrentPlugin

Constructors

new
CurrentPlugin(
type: { },
logger: Console,
config: PluginConfig,
memoryOptions: MemoryOptions,
)

Properties

[ENV]: { alloc: (n: bigint) => bigint; free: (addr: number) => void; load_u8: (addr: bigint) => number; load_u64: (addr: bigint) => bigint; store_u8: (
addr: bigint,
n: number,
) => void
; store_u64: (
addr: bigint,
n: bigint,
) => void
; input_offset: () => bigint; input_length: () => bigint; input_load_u8: (addr: bigint) => number; input_load_u64: (addr: bigint) => bigint; output_set: (
addr: bigint,
length: bigint,
) => void
; error_set: (addr: bigint) => void; config_get: (addr: bigint) => bigint; var_get: (addr: bigint) => bigint; var_set: (
addr: bigint,
valueaddr: bigint,
) => 0 | undefined
; http_request: (
_requestOffset: bigint,
_bodyOffset: bigint,
) => bigint
; http_status_code: () => number; length: (addr: bigint) => bigint; length_unsafe: (addr: bigint) => bigint; log_warn: (addr: bigint) => unknown; log_info: (addr: bigint) => unknown; log_debug: (addr: bigint) => unknown; log_error: (addr: bigint) => unknown; }

Methods

[BEGIN](input: number | null): void
[END](): [number | null, number | null]
[EXPORT_STATE](): CallState
[GET_BLOCK](index: number): Block
[IMPORT_STATE](
state: CallState,
copy?: boolean,
): void
[RESET](): void
[SET_HOST_CONTEXT](hostContext: any): void
[STORE](input?: string | Uint8Array): number | null

Allocate a chunk of host memory visible to plugins via other extism host functions. Returns the start address of the block.

Read a variable from extism memory by name.

hostContext<T = any>(): T
read(addr: bigint | number): PluginOutput | null

Given an address in extism memory, return a PluginOutput that represents a view of that memory. Returns null if the address is invalid.

Set a variable to a given string or byte array value. Returns the start address of the variable. The start address is reused when changing the value of an existing variable.

Store a string or Uint8Array value in extism memory.

Add Package

deno add jsr:@extism/extism

Import symbol

import { CurrentPlugin } from "@extism/extism";

---- OR ----

Import directly with a jsr specifier

import { CurrentPlugin } from "jsr:@extism/extism";

Add Package

npx jsr add @extism/extism

Import symbol

import { CurrentPlugin } from "@extism/extism";

Add Package

yarn dlx jsr add @extism/extism

Import symbol

import { CurrentPlugin } from "@extism/extism";

Add Package

pnpm dlx jsr add @extism/extism

Import symbol

import { CurrentPlugin } from "@extism/extism";

Add Package

bunx jsr add @extism/extism

Import symbol

import { CurrentPlugin } from "@extism/extism";