Nathan
Nathan

Reputation: 31

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

Upvotes: 3

Views: 225

Answers (1)

dthree
dthree

Reputation: 20740

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.

Upvotes: 2

Related Questions