Electron CLI app?

I’m building a conventional node.js CLI application using commander.js.

This means that if I want the application to be usable to end users, they must have node.js installed on their computers, so they can install it using “npm install -g myapp”.

At first I thought that maybe packaging the CLI app in Electron will make it dependency free and easier to distribute but I have no knowledge whatsoever of how Electron could help achieve this or if it’s even a good idea.

Any thoughts or recommendations?

Thats not really what Electron is for. Also, this would greatly inflate the file size since Electron would also have nodem chrome renderer, the v8 javascript engine, etc all bundled in as well. You’d probably be looking at a 100mb command line app.

You’d prob be much better off just leaving it as a node script and letting them download and install node.

1 Like

Why not write an install script that checks for Node and installs it if it’s missing, then downloads your app?

We have a similar need. We are building an electron app, but also require some system daemons to run along side it. We are in the design phase, but one of our considerations is limiting dependencies. We were hoping that we could run within the electron provided runtime to avoid having to require another environment. Any ideas?

you’re probably better off using nexe to compile into os targeted builds

Sorry to exhume this very old thread but I’m actually working on an “Electron for CLI apps” called Climax in case anybody is still interested.

1 Like