@nexustools/releasepackager
v1.0.0-beta.1
Published
Pure Node.js cross-platform executable and application release packager generating Windows (.zip, .msi), macOS (.dmg with drag-to-Applications .app), and Linux (.deb, .flatpak, .zip) releases with zero external tool dependencies
Maintainers
Readme
@nexustools/releasepackager
Pure Node.js, cross-platform Executable & Application Release Packager generating native installers and archives for Windows, macOS, and Linux from any host operating system with zero external tool dependencies.
Supports packaging any executable (compiled C/C++, Rust, Go, Zig, .NET, Python, Node SEA, custom runtimes, or multi-file application directories):
- Windows:
.zipRelease (win-zip): Portable application directory with renamed<executable>.exe, injected PE32/PE32+.rsrcicons (RT_ICON,RT_GROUP_ICON) andVS_VERSIONINFO(RT_VERSION)..msiInstaller (win-msi): Spec-compliant Windows Installer OLE2 Compound File (.msi) with embedded Microsoft Cabinet (media1.cab), interactive visual wizard (WelcomeDlgdescription & icon screen +InstallDirDlg&BrowseDlgfolder picker), configurableC:\Program Files\<installPath>installation directory, Desktop & Start Menu shortcuts, and Add/Remove Programs metadata.
- macOS:
- Mountable
.dmgDisk Image (mac-dmg): Apple Universal Disk Image Format (kolytrailer +blkxMishzlib-compressed blocks) wrapping a native HFS+ (Mac OS Extended) filesystem containing<ProductName>.app(automatically wrapping standalone Mach-O binaries or customizing existing.appbundles withContents/Info.plist,app.icns, andInfoPlist.strings), a Finder.DS_Storeicon-view layout, a.background/background.pngsplash image (customizable viamac.splashBackgroundor auto-generated with the app on the left, an arrow in the center, and Applications on the right), and a/Applicationssymbolic link for drag-and-drop installation intoApplications.
- Mountable
- Linux:
- Debian
.debPackage (linux-deb): Standard UNIXararchive (debian-binary,control.tar.gz,data.tar.gz) installing into/opt/<app>,/usr/bin/<app>,/usr/share/applications/<app>.desktop, and/usr/share/icons/hicolor/256x256/apps/<app>.png. - Flatpak Single-File Bundle (
linux-flatpak): Self-contained.flatpakGVariant + OSTree static-delta bundle with sandbox permissions,.desktopexport, and AppStream MetaInfo XML. .zipRelease (linux-zip): Portable archive preserving POSIX0755executable mode bits in the ZIP central directory alongside a.desktoplauncher.
- Debian
CLI Usage
# Generate a starter releasepackager.json config file
npx releasepackager --init
# Package any executable across Windows, macOS, and Linux
npx releasepackager --executable ./build/{platform}-{arch}/myapp{ext} --product-name "My App" --version 1.0.0
# Package an application directory for Windows (.zip, .msi)
npx releasepackager --input ./dist/win-x64 --platforms win --formats win-zip,win-msiProgrammatic API
import { ReleasePackager } from '@nexustools/releasepackager';
const packager = new ReleasePackager({
projectDir: './my-project',
outputDir: './release',
appName: 'my-app',
productName: 'My App',
version: '1.0.0',
appId: 'io.nexustools.myapp',
executables: {
'win-x64': './build/win-x64/my-app.exe',
'osx-x64': './build/osx-x64/my-app',
'osx-arm64': './build/osx-arm64/my-app',
'linux-x64': './build/linux-x64/my-app'
},
platforms: ['win', 'osx', 'linux'],
win: {
arch: ['x64'],
formats: ['win-zip', 'win-msi'],
manufacturer: 'NexusTools',
installPath: 'NexusTools\\MyApp',
description: 'High-performance cross-platform desktop application',
icon: './assets/icon.ico'
},
mac: {
arch: ['x64', 'arm64'],
formats: ['mac-dmg'],
splashBackground: './assets/dmg-splash.png' // optional; auto-generated if omitted
},
linux: {
arch: ['x64'],
formats: ['linux-deb', 'linux-flatpak', 'linux-zip']
}
});
const result = await packager.packageAll();
console.log(result.artifacts);