Socket
Book a DemoInstallSign in
Socket

pkg-exe-build

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pkg-exe-build

Configure Windows PKG package generated exe file icon and detailed information windows 平台下 配置图标及详细信息 使用 pkg 打包 生成 exe 文件

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
18
157.14%
Maintainers
1
Weekly downloads
 
Created
Source

pkg-exe-build

GitHub tag (latest by date) License: LGPL-3.0-or-later

中文文档 | English Documentation

A Node.js tool for configuring Windows PKG package generated exe file icons and detailed information. This project is a fork of AngaBlue/exe version 2.0, with updates and improvements.

🏠 Homepage

⚠️ Breaking Changes from 1.X

This version introduces several breaking changes compared to the 1.X series:

  • Repository: New repository at https://github.com/PromiseAll/pkg-exe-build
  • PKG Dependency: Updated to use @yao-pkg/pkg instead of the original pkg package
  • Build System: Now uses tsup for building instead of the previous build system
  • Module System: Full ES Module support with both ESM and CommonJS exports
  • CLI Command: The package now provides a short CLI command alias pkge for easier usage

Install

Install this package and save to devDependencies using your package manager of choice.

npm i -D pkg-exe-build

Command Line Usage

You can also use the command line interface to build executables. The package provides a short CLI command alias pkge for convenience:

npx pkge -e ./index.js -o ./build/My Cool App.exe

Command Line Options

OptionDescriptionRequiredDefault ValueExample Value
-e, --entryPath to the entry file of the application.YesN/A./index.js
-o, --outPath for the output executable file.YesN/A./build/My Cool App.exe
-p, --pkgExtra arguments for the pkg package.No[]-C GZip
-t, --targetTarget node version and architecture.Nolatest-win-x64latest-win-x64
--app-versionVersion of the application.NoNone2.4.2
-i, --iconPath to the application's icon in .ico format.NoNode.js icon./assets/icon.ico
-l, --execution-levelExecution level for the application.NoasInvokerasInvoker
--propertiesMetadata for the executable file (JSON format).NoNone'{"FileDescription":"My Cool App"}'

Command Line Examples

Basic usage:

npx pkge -e ./index.js -o ./build/My Cool App.exe

Full parameters:

npx pkge \
  -e ./index.js \
  -o ./build/My Cool App.exe \
  -p -C GZip \
  -t latest-win-x64 \
  --app-version 2.4.2 \
  -i ./assets/icon.ico \
  -l asInvoker \
  --properties '{"FileDescription":"My Cool App","ProductName":"My Cool App","LegalCopyright":"PromiseAll https://github.com/PromiseAll","OriginalFilename":"My Cool App.exe"}'

Basic Usage

// build.js
import pkgBuild from "pkg-exe-build";

const build = pkgBuild({
  entry: "./index.js",
  out: "./build/My Cool App.exe",
});

build.then(() => console.log("Build completed!"));

Or using CommonJS:

// build.js
const pkgBuild = require("pkg-exe-build");

const build = pkgBuild({
  entry: "./index.js",
  out: "./build/My Cool App.exe",
});

build.then(() => console.log("Build completed!"));

Example Usage

Specify more arguments and completely customize the resultant executable.

// build.js
import pkgBuild from "pkg-exe-build";

const build = pkgBuild({
  entry: "./index.js",
  out: "./build/My Cool App.exe",
  pkg: ["-C", "GZip"], // Specify extra pkg arguments
  version: "2.4.2",
  target: "latest-win-x64",
  icon: "./assets/icon.ico", // Application icons must be in .ico format
  executionLevel: "asInvoker",
  properties: {
    FileDescription: "My Cool App",
    ProductName: "My Cool App",
    LegalCopyright: "PromiseAll https://github.com/PromiseAll",
    OriginalFilename: "My Cool App.exe",
  },
});

build.then(() => console.log("Build completed!"));

Configuration Options

OptionDescriptionRequiredDefault ValueExample ValuePossible Values
entryPath to the entry file of the application.YesN/A'./index.js'Any valid file path.
outPath for the output executable file.YesN/A'./build/My Cool App.exe'Any valid file path.
pkgExtra arguments for the pkg package.No[]['-C', 'GZip']Array of pkg arguments.
versionVersion of the application.NoNone'2.4.2'Semantic version string. e.g. major.minor.patch
targetTarget node version and architecture.No'latest-win-x64''latest-win-x64'Windows pkg target string. e.g. latest-win-x64, node18-windows-x64, etc.
iconPath to the application's icon in .ico format.NoNode.js icon'./assets/icon.ico'Any valid .ico file path.
executionLevelExecution level for the application.No'asInvoker''asInvoker'asInvoker, highestAvailable, requireAdministrator
propertiesMetadata for the executable file.NoNone{ FileDescription: 'My Cool App', ... }Key-value pairs as shown in example.

Note on properties:

  • FileDescription: Description of the executable.
  • ProductName: Name of the product.
  • LegalCopyright: Copyright details with the URL.
  • OriginalFilename: Name of the original file.

Development

To build the project:

npm run build

To run tests:

npm test

To run CLI tests:

npm run test:cli

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © PromiseAll.
This project is LGPL-3.0-or-later licensed.

Acknowledgments

This project is based on AngaBlue/exe version 2.0.

Keywords

pkg

FAQs

Package last updated on 13 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.