Giter Site home page Giter Site logo

angablue / exe Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 0.0 187 KB

Build a portable binary for Windows systems using Vercel's pkg

Home Page: https://www.npmjs.com/package/@angablue/exe

License: GNU Lesser General Public License v3.0

JavaScript 2.92% TypeScript 97.08%
nodejs executable binary build javascript windows typescript

exe's Introduction

Node.js Windows Executable

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

Build a portable binary for Windows systems using Vercel's pkg. As pkg doesn't support modifying executable properties, this project serves to and aid in automating modifying the executable properties post build with the aid of resedit-js.

๐Ÿ  Homepage

Install

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

 npm i -D @angablue/exe

Basic Usage

// 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",
  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: "AngaBlue https://anga.blue",
    OriginalFilename: "My Cool App.exe",
  },
});

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

Configuration Options

Option Description Required Default Value Example Value Possible Values
entry Path to the entry file of the application. Yes N/A './index.js' Any valid file path.
out Path for the output executable file. Yes N/A './build/My Cool App.exe' Any valid file path.
pkg Extra arguments for the pkg package. No [] ['-C', 'GZip'] Array of pkg arguments.
version Version of the application. No None '2.4.2' Semantic version string. e.g. major.minor.patch
target Target node version and architecture. No 'latest-win-x64' 'latest-win-x64' Windows pkg target string. e.g. latest-win-x64, node18-windows-x64, etc.
icon Path to the application's icon in .ico format. No Node.js icon './assets/icon.ico' Any valid .ico file path.
executionLevel Execution level for the application. No 'asInvoker' 'asInvoker' asInvoker, highestAvailable, requireAdministrator
properties Metadata for the executable file. No None { 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.