I built simple command line application using commander.js
for Node.js platform.
Now I want to compile it to simple exe
file, Which I can execute directly.
Means I want single executable file for complete application
This is my application structure
APP_ROOT
| - package.json
| - node_modules
| - node_modules/.bin/myapp.bat
| - node_modules/myapp/bin/myapp
| - node_modules/myapp/bin/myapp-action1
| - node_modules/myapp/bin/myapp-action2
Thanks
pkg
module using npm i -g pkg
package.json
Filejson
{
"name": "my-app-exe",
"version": "1.0.0",
"description": "Myapp-Cli tool as executable",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"myapp",
"cli",
"exe"
],
"author": "Shisht",
"license": "MIT",
"devDependencies": {
"myapp": "1.0.0"
},
"bin": "node_modules/myapp-cli/bin/cli",
"pkg": {
"assets": "node_modules/**/*"
},
"help": "pkg . --target host --output myapp-1.0.0-x64.exe --debug"
}
myapp
to myapp.exe
pkg . --target host --output myapp-1.0.0-x64.exe --debug