API for pkg.
npm install pkg pkg-api
const pkg = require("pkg-api");
await pkg("index.js", {
targets: "node10-win",
output: "dist/output.exe"
});
Type: string
The entry file to build.
Type: object
Type: boolean
Default: false
Whether to compile base binaries instead of downloading them.
Type: boolean
Default: false
Whether to log the packaging process.
Type: string
Default: package.json
A package.json
or any other json file containing the top-level config.
Type: string
A space-separated list of runtime options to pass to Node.js/V8.
Type: string
If only 1 executable is created, set its path.
The output directory to place the executables for multiple targets.
A command-separated list of targets to build for.
- pkg - CLI used by this API.