Member-only story
Get Started with Writing Desktop Apps with Electron
3 min readOct 7, 2020
Electron is a framework that lets us create cross-platform desktop apps.
The apps are created by creating web apps that are wrapped with a wrapper.
In this article, we’ll look at how to create our first Electron app.
Getting Started
We’ve to use a recent version of Node.js to create our desktop app.
First, we install Electron by running:
npm install --save-dev electron
To create the app, we create a project folder and run npm init --yes
to create a package.json
file.
Then we add the main.js
to as the value of main
.
This defines the entry point of our app.
The whole package.json
file would look something like:
{
"name": "electron-example",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"repository": {
"type": "git",
"url": "git+https://hauyeung@bitbucket.org/hauyeung/electron-example.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"homepage": "https://bitbucket.org/hauyeung/electron-example#readme"
}