Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile NodeJS command line application

I've built a simple web scraper that runs on the command line using NodeJS. I'm looking for a way to produce a single, self-contained file/executable that someone else can just click and run.

The app is using a few external modules like cheerio and fs-extra, as well as some others.

What are the options for compiling/packaging a command line app like this that prevents users from having to install node on their machines?

Many Thanks

like image 949
Nathan Avatar asked Apr 23 '26 08:04

Nathan


1 Answers

The closest that I know of is to publish it as a Node module, and then it's simply:

$ npm install superscaper -g

Node is a runtime for Javascript. You pretty much need it to run Javascript, or the installer you would bundle would have to do all of Node's heavy lifting anyway and so would be pretty big.

like image 185
dthree Avatar answered Apr 25 '26 00:04

dthree



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!