![]() ![]() I was curious how much space these take up: $ ls -lh The target platforms can be customized by using the -targets flag. This by default builds executables for three platforms - Windows, Linux and Mac: $ ls -1 We can package this by running: $ npx pkg index.js This file prints “hello world” and exits. Let’s start with a simple example: // index.js We can use pkg to compile our code into a single executable file for multiple target platforms (Windows, Linux, Mac etc). It would be a lot easier for users if we can package our app into a single executable file that they can download and run without installing anything extra. If you’re writing command line tools in Node.js, it can be hard to distribute them since users need to install Node.js in their machines before being able to use your tool.
0 Comments
Leave a Reply. |