3.2.3 • Published 5 months ago

@angablue/exe v3.2.3

Weekly downloads
-
License
LGPL-3.0-or-later
Repository
github
Last release
5 months ago

Build a portable binary for Windows systems using Node's SEA. This project serves to and aid in automating bundling your source code with @vercel/ncc and modifying the executable properties post build with resedit-js.

🏠 Homepage

Install

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

npm i -D @angablue/exe

⚠️Warning⚠️: This package is only supported on Windows systems running Node v20.0.0 or newer. For older versions of Node (v12.0.0 or newer), please use the version v2.1.3 of this package

npm i -D @angablue/exe@2.1.3

Please note that the older version of this package is no longer maintained. Refer to the previous documentation here.

CLI Usage

Point to a JSON configuration file (default exe.json) to build your executable:

npx exe exe.json

Configuration File

Create a JSON configuration file (exe.json) with the following options:

{
    "entry": "index.js",
    "out": "My Cool App.exe"
}

@angablue/exe has first-class TypeScript support. You can use it in your TypeScript projects without any additional configuration by specifying your TypeScript entry file (such as index.ts).

Optionally, you can specify more arguments and completely customise the resultant executable:

{
    "entry": "index.js",
    "out": "My Cool App.exe",
    "skipBundle": false,
    "version": "{package:version}",
    "icon": "icon.ico",
    "executionLevel": "asInvoker",
    "properties": {
        "FileDescription": "{package:description}",
        "ProductName": "My Cool App",
        "LegalCopyright": "Copyright {package:author.name}",
        "OriginalFilename": "{package:name}"
    }
}

API Usage

If you prefer to use this package programmatically, you can import this module into your Node.js script:

// build.js
const exe = require("@angablue/exe");

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

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

Example Usage

Specify more arguments and completely customise the resultant executable.

// build.js
const exe = require("@angablue/exe");

const build = exe({
  entry: "./index.js",
  out: "./build/My Cool App.exe",
  skipBundle: false,
  version: "2.4.2",
  icon: "./assets/icon.ico", // Application icons must be in .ico format
  executionLevel: "asInvoker",
  properties: {
    FileDescription: "My Cool App",
    ProductName: "My Cool App",
    LegalCopyright: "AngaBlue https://anga.blue",
    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 to a .js/.ts script.
outPath for the output executable file.YesN/A'./build/My Cool App.exe'Any valid file path (ending with .exe).
skipBundleSkip the bundling process and use provided entry file as is.NofalsetrueBoolean
versionVersion of the application.NoNone'2.4.2'Semantic version string. e.g. major.minor.patch
iconPath to the application's icon in .ico format.NoNode.js icon'./assets/icon.ico'Any valid file path to a .ico icon.
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.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright Š AngaBlue. This project is LGPL--3.0--or--later licensed.

3.2.2

5 months ago

3.0.4

5 months ago

3.0.3

5 months ago

3.2.0

5 months ago

3.0.2

5 months ago

3.1.0

5 months ago

3.0.1

5 months ago

3.2.3

5 months ago

3.0.0

5 months ago

2.1.3

8 months ago

2.1.2

11 months ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.2

1 year ago

2.0.0

1 year ago

1.2.0

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago