Saturday 24 June 2017

Building Cross-Platform Desktop Apps using Electron

Building cross platform desktop apps using Electron



Electron is a framework for building native applications for different frameworks. It allows us to build applications for different operating systems. It uses all the technologies which a web developer uses like HTML, CSS or JavaScript. Now it also uses NodeJS and Chromium, so now with NodeJS you have access to files and file operations as well. It uses Chromium which is a web browser that gives you ability to do debugging and enable us to use features of HTML/CSS and JavaScript.The best thing about Electron is that it creates the cross platform versions of applications for you.So it takes, essentially what is a web application, and converts it so that it runs natively on all kinds of different platforms.

Other frameworks which will help us to build an application with Electron

Bootstrap: It has a lot of interface elements and components that will make it easier to build things like modals and drop-downs

React: Gives you the ability to create applications where you don't have to worry about updating the document object model or DOM manually

Creating an App

In order to create an App using Electron we need to setup few things in order to start working.

We need to create a package.json file like any other NodeJS application to have some information of the application along with the dependencies.

We need a main process which is going to setup our application and we can also mention it in the package.json file in the script field.

We need to install the Electron npm package, as recommended, do locally and globally.

Electron after all is technically just a browser so the Renderer Process is what goes inside your "browser window". Now the Main and Renderer process can talk to each other

No comments:

Post a Comment