import { dlopen } from "https://deno.land/x/skia_canvas@0.5.2/deps.ts";
Opens a dynamic library and registers symbols, compatible with Deno.dlopen yet with extended functionality allowing you to use remote (or local) binaries, automatically building the binary name and controlling the caching policy.
Examples
Example 1
Example 1
import { dlopen, FetchOptions } from "https://deno.land/x/plug/mod.ts";
// Configure plug to automatically guess the binary names for you, even when
// there for example are special rules for naming on specific architectures
const options: FetchOptions = {
name: "test",
url: "https://example.com/some/path/",
suffixes: {
darwin: {
aarch64: ".aarch64",
x86_64: ".x86_64",
},
},
// Becomes:
// darwin-aarch64: "https://example.com/some/path/libexample.aarch64.dylib"
// darwin-x86_64: "https://example.com/some/path/libexample.x86_64.dylib"
};
await dlopen(options, {});
Parameters
options: FetchOptions
See FetchOptions
symbols: S
A record extending Deno.ForeignLibraryInterface
Returns
Promise<Deno.DynamicLibrary<S>>
An opened Deno.DynamicLibrary