nodegui-builder
v1.0.1
Published
Tool for packaging NodeGUI applications into standalone executables
Downloads
1
Maintainers
Readme
NodeGUI Builder
Tool for packaging NodeGUI applications into standalone desktop applications for Windows.
Installation
npm install -g nodegui-builderOr install locally in your project:
npm install --save-dev nodegui-builderUsage
Preparing your package.json
You can also add a packaging script to simplify the build process:
{
"scripts": {
"package": "nodegui-builder --name MyApp --source ./my-project --output ./dist --main app.js",
// ...other scripts
}
}Once you've configured your package.json file, you can run:
npm run packageThis will execute the packaging process using the parameters defined in your script.
In JavaScript code
const { packageApp } = require('nodegui-builder');
packageApp({
appName: 'MyApp',
sourceDir: './my-project',
outputDir: './dist',
mainFile: 'main.js',
additionalModules: ['moment', 'lodash']
}).then(appDir => {
console.log(`Application packaged to: ${appDir}`);
}).catch(err => {
console.error('Packaging failed:', err);
});Options
| Option | Description | Default |
|----------|-------|----------|
| --name, -n | Application name | NodeGUIApp |
| --source, -s | Application source directory | Current directory |
| --output, -o | Output directory | ./deploy |
| --main, -m | Main application file | main.js |
| --add-module, -a | Additional npm modules to package | [] |
Results
After packaging, the application will include:
- An executable
.exefile to launch the application - A
.batbatch file to launch from command line - All necessary libraries and dependencies
Troubleshooting
If the .exe file (other than qode.exe) is not found after packaging, you can manually compile it by:
- Navigate to your packaged application directory
- Run the
_compile.batscript which is included in the output directory - This will create the executable launcher for your application
Requirements
- Windows
- Node.js 14+
- NodeGUI application with all dependencies installed
License
MIT
