From future self: Question was made by silly me who didn't know compilation process and how Node.js work with native bindings, future me have done native bindings and ffi and improved question to be more "googleable" and provide minimal insight on similar problems.
I've seen some people who deliver applications as executables and I wanted to reproduce such outcome with Node.js, I've tried to use nexe
and pkg
tools which seem to promote outcome that I want to archive, yet when I tried to use them I constantly keep getting problem with missing .node
files from bcrypt
and realm
in my application.
In every place where I was looking for solution I was seeing that "solution" for this problem is excluding realm
and bcrypt
from JavaScript bundle as they either take too much space or are not performant, as these can be installed from npm yet the outcome wanted archive is Single Executable Application (SEA) and I do not have clue what to do next.
TL;DR
Ecosystem shifted a lot recently, when one is using ESModules it's possible to bundle runtime and code into SEA with usage of Bun and Deno.
Resources that I have found over time: