4 ms·
I wonder if CLI tools could be put into a single zipfile with all the dependencies inside and just ran from there. Just like php's phar files. Or even better,
by hiccuphippo 8y ago
I wonder if CLI tools could be put into a single zipfile with all the dependencies inside and just ran from there. Just like php's phar files.
Or even better, compile into a wasm binary.
- thangngoc89 8y ago1. Yes. If your CLI tool is written entirely in JS, you can even bundle all files into a single file and ship the JS file. With native dependencies, you need to use other solutions. 2. Compile into a wasm binary is not possible because JS is an dynamically typed language. No type at compilation time
- folkrav 8y agoThere are things like nexe[1] and pkg[2] but the resulting executables end up pretty bloated (30+ MBs for a simple hello world, cause they all end up bundling Node in some way with every executable). nexe doesn't support native Node modules either, IIRC. [1] https://github.com/nexe/nexe https://github.com/nexe/nexe [2] https://github.com/zeit/pkg https://github.com/zeit/pkg
- tracker1 8y agoAnd when you need to support Linux, Windows and Mac for developers?
- hiccuphippo 8y agoThey still need to install Node. This is just a zip file that Node would run that contains all the dependencies inside the zip.
- tracker1 8y agoSo, you need to include the linux, windows and mac versions in your zip file at the very least for binary dependencies?