free
web stats

Electron Js Tutorials – Installing and First Application

Electron Js Framework has become a lot popular these days because of its portability on multiple operating systems and developing desktop apps with the front-end technologies like Javascript.

Using Electron what you can do is you can create awesome desktop applications with UI. You can create sort of notifications as well using the native libraries of a particular operating system and etc…

You can use the applications on Windows, Linux or Mac. It’s cross-platform application creator.

So how we install electron js?

First of all what you need to do is install nodejs if you do not have that. Because electron will be actually using node js. You can download and install node js here; https://nodejs.org/en/

Then we can install electron with cmd. Open cmd and write this command;

npm install electron -g

This code will install electron js. It might take a couple of minutes depending upon ypu computer’s performans.

I’m going to create new folder named electronjs and create new folder inside this folder named electron-example.

Open cmd here and write this command

npm init

cmd will ask some questions like package name, version, description,. Just press enter.

After then we have package.json file. We need two file also. index.js and index.html. Create these files as empty.

Now we need to IDE for editing these files and write our application. I’m using Visual Studio Code IDE.

Open IDE and write these codes inside the index.html file.

Then open index.js file and write these codes inside;

 

Finally write to cmd this code;

electron .

and open our first Electron Js application 🙂

You may also like...

1 Response

Leave a Reply

Your email address will not be published. Required fields are marked *