A powerful C# tool that packages Node.js applications into standalone executables. Convert your Node.js projects into self-contained .exe files that can run on any Windows machine without requiring Node.js to be installed.
- Zero Dependencies: Creates completely self-contained executables
- Automatic Node.js Download: Fetches the latest LTS version automatically
- Smart Packaging: Excludes existing node_modules and installs fresh dependencies
- Cross-Platform Support: Works on Windows, Linux, and macOS
- Professional Architecture: Clean, maintainable code with proper separation of concerns
- Easy to Use: Simple command-line interface
- .NET Framework 4.0 or higher
- Visual Studio or .NET SDK (for compilation)
- Internet connection (for downloading Node.js)
- Clone the repository:
git clone https://github.com/imtaqin/NODEPACKER.git
cd NODEPACKER- Build the project:
dotnet buildNodeJsPacker.exe <source-directory> <output-executable>Example:
NodeJsPacker.exe "C:\MyNodeApp" "C:\Output\MyApp.exe"This will:
- Download the latest Node.js LTS version
- Package your application with Node.js runtime
- Create a standalone executable that runs your app
NodeJsPacker/
??? Program.cs # Entry point
??? Models/
? ??? NodeJsRelease.cs # Node.js release data model
??? Services/
? ??? NodeJsPackerService.cs # Main orchestration service
? ??? NodeJsDownloader.cs # Handles Node.js downloads
? ??? ApplicationPackager.cs # Packages the application
? ??? ExecutableGenerator.cs # Creates the final executable
? ??? Interfaces/ # Service interfaces
??? Utils/
? ??? PlatformHelper.cs # Platform detection utilities
? ??? FileHelper.cs # File operations
? ??? DirectoryHelper.cs # Directory operations
? ??? ProcessHelper.cs # Process execution utilities
? ??? CompilerHelper.cs # C# compiler utilities
??? Templates/
??? LauncherCodeTemplate.cs # Generated launcher code
- Download: Automatically downloads the latest Node.js LTS version
- Package: Copies your application files (excluding node_modules)
- Dependencies: Installs production dependencies using npm
- Bundle: Creates a launcher application that extracts and runs your Node.js app
- Compile: Generates a standalone executable with embedded resources
- Must have a
package.jsonfile (recommended) - Should specify a main entry point in package.json
- If no main entry is specified, NodePacker will look for:
index.jsapp.jsmain.jsserver.js
- Windows: .NET Framework 4.0+, Visual Studio or Build Tools
- Linux/macOS: Mono or .NET Core
NodeJsPacker <source-directory> <output-executable><source-directory>: Path to your Node.js application folder<output-executable>: Path where the executable will be created
When running the generated executable, you can specify a custom entry point:
MyApp.exe server.jsYou can pass arguments to your Node.js application:
MyApp.exe server.js --port 3000 --env productionNodePacker follows clean architecture principles:
- Services: Core business logic with dependency injection ready
- Models: Data structures and DTOs
- Utils: Helper classes and utilities
- Templates: Code generation templates
- Interfaces: Contracts for better testability
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Clone the repository
- Open in Visual Studio or your preferred IDE
- Restore NuGet packages
- Build and run tests
This project is licensed under the MIT License - see the LICENSE file for details.
- Large applications may take some time to package
- Antivirus software might flag the executable (false positive)
- Cross-compilation between different platforms not fully supported yet
- Support for custom Node.js versions
- GUI interface
- Docker support
- Plugin system for custom packaging logic
- Improved cross-platform compilation
- Size optimization features
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Join our discussions in the Discussions tab
- Node.js team for the amazing runtime
- Microsoft for .NET Framework
- All contributors who help improve this project
Made with love by imtaqin
If this project helped you, please consider giving it a star!