wnpkg is a tiny utility that packages a Node.js application into a portable executable — works on Windows and Linux.
- Automatically wraps your Node.js script into a standalone executable
- Includes the Node.js runtime (
node.exeon Windows,nodeon Linux) - Optional custom icon support (
icon.ico) - Generates a clean build structure in
wnpkg-build/ - Super lightweight — written in pure C using
gcc
wnpkg <project-folder>
This command will:
- Copy
node(ornode.exeon Windows) and yourindex.jsinto a build folder. - Compile a small C launcher using
gcc. - Output a single executable:
- On Windows:
my-app.exe - On Linux:
my-app(ELF binary without file extension)
- On Windows:
wnpkg my-app
This will create the following structure:
wnpkg-build/
├── source/
│ ├── index.js <-- Your Node.js app
│ └── node(.exe) <-- Node.js runtime
├── my-app(.exe) <-- Final executable
- On Windows, just double-click
my-app.exeto run your app. - On Linux, run it with:
./my-app
To embed a custom icon in the Windows executable:
- Place your
icon.icofile in the project folder. wnpkgwill automatically detect and include it in the.exe.
You can customize the app name and icon by creating a file named wnpkg_config in your project folder. This file should contain:
app-name;
icon.ico;
- Replace
app-namewith the desired output name. - If you don't want to use an icon, simply use a
*instead:
my-app;
*;
- Windows or Linux (32 or 64 bit)
- GCC / MinGW installed and available in PATH
This project was built for fun and utility — feel free to hack it, improve it or fork it.