Skip to content

Richienb/pkg-api

Repository files navigation

pkg-api Travis CI Build Status

API for pkg.

NPM Badge

Install

npm install pkg pkg-api

Usage

const pkg = require("pkg-api");

await pkg("index.js", {
	targets: "node10-win",
	output: "dist/output.exe"
});

API

pkg(input, options?)

input

Type: string

The entry file to build.

options

Type: object

build

Type: boolean
Default: false

Whether to compile base binaries instead of downloading them.

debug

Type: boolean
Default: false

Whether to log the packaging process.

config

Type: string
Default: package.json

A package.json or any other json file containing the top-level config.

options

Type: string

A space-separated list of runtime options to pass to Node.js/V8.

output

Type: string

If only 1 executable is created, set its path.

outDir

The output directory to place the executables for multiple targets.

targets

A command-separated list of targets to build for.

Related

  • pkg - CLI used by this API.