A simple Node.js/Chromium desktop quickstart, which can run on both Electron and NW.js. Useful for testing JavaScript libraries.
package.json
: Installs prebuilt versions of Electron and NW.js, and configures various startup options for the app.index.html
: HTML file used for the app.main.js
: First script executed in the main process/Node context, which is used to further execute eitherelectron/main.js
ornw/node.js
.renderer.js
: First script executed in the renderer process/browser context, which is used to further execute eitherelectron/renderer.js
ornw/browser.js
. Common functions can be exposed as globals here for easy access from both Electron and NW.js.electron/main.js
: Script which will be executed in Electron's main process, used to open the first Electron window.electron/renderer.js
: Script which will be executed in Electron's renderer process.nw/node.js
: Script which will be executed in NW.js's Node context, used to open the first NW.js window.nw/browser.js
: Script which will be executed in NW.js's browser context.
You’ll need to have Git and Node.js (which comes with npm) installed on your computer.
# Clone this repository.
$ git clone https://github.com/demoneaux/node-desktop-quickstart
# Go into the repository.
$ cd node-desktop-quickstart
# Install dependencies - prebuilt versions of Electron and NW.js.
$ npm install
# Run the app.
$ npm run electron # Run on Electron.
$ npm run nw # Run on NW.js.
Framework | Version | Node | Chromium |
---|---|---|---|
Electron | 1.7.11 | 7.9.0 | 58 |
NW.js | 0.28.0 (SDK) | 9.4.0 | 64 |