3 ms·
Could you share how that can be done? I spent some time this year trying to pack a node tool into a single fat binary for a specific use case where we wanted a
by dgellow 3y ago
Could you share how that can be done? I spent some time this year trying to pack a node tool into a single fat binary for a specific use case where we wanted a history of versioned executables - i.e a build job that needs to run specific versions of the packed tool in a specific order determined by external factors.
I tried Vercel pkg, Vercel ncc, nexe, and a few other tools I can’t remember right now. They all had issues with node v20, some dependencies, or seemed to not be maintained anymore. I ended up relying on esbuild as a compromise to get a fat script containing all sources and dependencies, tarballed with some static files we rely upon we can at least get versioned, reproducible runs (modulo the node env). Still not perfect, a single binary would be preferable
- binarymax 3y agoI’ve used pkg with success for some small apps - curious to know why it didn’t work for you. Now you can use this native feature (not totally stable yet though) which I’ve been meaning to try https://nodejs.org/api/single-executable-applications.html https://nodejs.org/api/single-executable-applications.html
- dgellow 3y agoI don't remember the details, and cannot find my notes on vercel/pkg. But looking at https://github.com/vercel/pkg https://github.com/vercel/pkg right now I see the project has been deprecated in favour of single-executable-applications
- binarymax 3y agoBummer that they deprecated/archived it before the native feature was stable.