Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

Shell programming in Javascript with Node. How to deploy the completed CLI app?

$
0
0

I have a simple CLI application written in Javascript using Node that is for internal use by a small team. It runs in the Linux terminal as a CLI app. You can think of it as a shell script written in Javascript. (I probably could have implemented it in Bash, but the logic is complex and Bash was not the right language. The best choices for me were Perl, Python or Javascript, and I decided to try Javascript.) The app is completed and it works as intended. The problem I face now is how to deploy it to our internal team using a simple method that fits with our routine process of keeping end user computers updated.

It seems a lot of people have discussed using Javascript for shell programming, but this issue of deploying the completed app is not widely discussed. I have not found anything on the topic.

Our app needs to be installed once per workstation / laptop and to be available to all users on that computer. Any user should be able to open a terminal and enter the command to run the app.

The app consists of a single ".js" file and requires just a few Node packages.

So far I have been recommended solutions that are appropriate for either development environments or web servers.

This app is not a web app and it is not deployed on a server. It needs to run offline. I am also not asking about developing or maintaining the app on a development workstation.

The installation process should ideally be as about simple as installing a shell script in /usr/local/bin and setting permissions so all permitted users on a computer can run it. We are looking for an installation method like this:

  • copy the Javascript file only once to each computer (to a location on the $PATH) and make sure the Node packages are available globally on that computer.

  • I specifically want to avoid having to do an npm install for each user account on each computer.

  • I also want to avoid having to update Node packages for each user account on each computer.

A developer will keep the app updated so it is always compatible with the latest version of the Node packages, and all computers it is deployed on will always have the latest versions of those packages installed.

One specific problem I encountered is discussed here, but the answers assume a different set of requirements (such as the need for "multiple applications running on different package versions").


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>