Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/deno/cli/js/lib.deno.unstable.d.ts>Deno.openPlugin

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.openPlugin
import { Deno } from "https://deno.land/x/deno@v1.0.0/cli/js/lib.deno.unstable.d.ts";
const { openPlugin } = Deno;

UNSTABLE: new API, yet to be vetted.

Open and initalize a plugin.

   const rid = Deno.openPlugin("./path/to/some/plugin.so");
   const opId = Deno.core.ops()["some_op"];
   const response = Deno.core.dispatch(opId, new Uint8Array([1,2,3,4]));
   console.log(`Response from plugin ${response}`);

Requires allow-plugin permission.

The plugin system is not stable and will change in the future, hence the lack of docs. For now take a look at the example https://github.com/denoland/deno/tree/master/test_plugin

Parameters

filename: string

Returns

number