Mqx
Mqx2h ago

Publish binaries to JSR and load them using Deno.dlopen()

Hey is it possible to publish binary files such as .dll or .so files and then access them via Import in an other package? I would like to publish binaries to JSR, for example like this: deno.json
{
"name": "@mypackage/binaries",
"version": "0.1.0",
"exports": {
"./bin.dll": "./path/to/bin.dll"
}
}
{
"name": "@mypackage/binaries",
"version": "0.1.0",
"exports": {
"./bin.dll": "./path/to/bin.dll"
}
}
So that I could then install the package and use the binary via an import, for example like this:
import bin from "@mypackage/binaries/bin.dll"

const lib = Deno.dlopen(bin, …);
import bin from "@mypackage/binaries/bin.dll"

const lib = Deno.dlopen(bin, …);
Is this somehow possible? I know there are 3rd party libraries like plug that do something like this, but I am just curious if I could get this to work without something like plug.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?