testdesktophelloworldapp
v1.0.0
Published
A minimal Electron Hello World app distributed as a global npm command.
Readme
testDesktopHelloWorldApp
A minimal Electron proof of concept that is packaged with its own Electron runtime, published through npm, and launched by a global terminal command.
Project structure
bin/testDesktopHelloWorldApp.js Global CLI launcher
src/main.js Electron main process source
src/index.html Hello World renderer
scripts/ Small build/verification helpers
build/ Minified intermediate output (generated)
release/mac-universal/ Self-contained macOS app (generated)
payload/ Symlink-safe npm payload zip (generated)Only the launcher, installer, package.json, README, and generated macOS app archive
are included in the npm package. Source, build scripts, and development dependencies are excluded.
The application code inside the .app is stored in Electron's app.asar archive;
the JavaScript main process is bundled and minified first.
The .app is zipped with macOS ditto because npm tarballs do not preserve the
framework symlinks inside an Electron application. npm's postinstall extracts it
to the package's runtime directory; the CLI also performs this check as a fallback.
Build locally
Requirements: macOS, Node.js 18 or newer, and npm.
npm install
npm run build
npm run verify:packageThe build creates a universal macOS application at
release/mac-universal/testDesktopHelloWorldApp.app. Code signing and notarization
are disabled for this proof of concept.
Test the global npm installation locally
npm run build
npm pack
npm install -g ./testdesktophelloworldapp-1.0.0.tgz
cd /tmp
testDesktopHelloWorldAppRemove the local test with npm uninstall -g testdesktophelloworldapp.
If macOS blocks the unsigned app, allow it in System Settings → Privacy & Security, or Control-click the app and choose Open. This is expected because the POC is neither signed nor notarized.
Publish to npm
The unscoped npm name must be available and your npm account must be logged in:
npm login
npm run build
npm pack --dry-run
npm publishnpm package names are lowercase, so the canonical install command is:
npm install -g testdesktophelloworldappThe requested mixed-case spelling normally resolves to the same registry package:
npm install -g testDesktopHelloWorldAppAfter installation, from any directory, run exactly:
testDesktopHelloWorldAppNo separate Electron installation and no electron . or npm start command is required.
