Mqx
Mqx2w ago

Binary files in jsr package

Hey I am currently trying to understand the „new“ (for me) package format (jsr.json) for Deno packages and I was wandering how binary files are handled in such a package when using the package. For example if I have a DLL file for my ffi module can I just include it in the include statement inside the jsr.io file so that it gets cached when I use the package? Or do I need relay on a library like plug that downloads non ts/js files that I need?
2 Replies
jeff.hykin
jeff.hykin2w ago
Idk about jsr, but if you want it to work with bundlers (and JSR) I made this tools a couple years ago for binary files. It let's you import anything as a Uint8Array. I used it to make deno-tree-sitter and also use it in a couple other of my deno modules https://github.com/jeff-hykin/binaryify/
GitHub
GitHub - jeff-hykin/binaryify: 💾 📦 ✅ bundling misc files into Java...
💾 📦 ✅ bundling misc files into Javascript. Contribute to jeff-hykin/binaryify development by creating an account on GitHub.
Mqx
Mqx2w ago
Okay thanks I will check that out So this module just simply converts the binary file into a js file with a Uint8Array? Am I right?