Electron is an open source library developed by GitHub for building cross-platform desktop applications with HTML, CSS, and JavaScript. Electron accomplishes this by combining Chromium and Node.js into a single runtime and apps can be packaged for Mac, Windows, and Linux.

Electron enables you to create desktop applications with pure JavaScript by providing a runtime with rich native (operating system) APIs.

This does not mean Electron is a JavaScript binding to graphical user interface (GUI) libraries. Instead, Electron uses web pages as its GUI, so you can also see it as a minimal Chromium browser, controlled by JavaScript. So all the electron apps are technically web pages running in a browser that can leverage your OS APIs.

 

Electron Users

  • GitKraken git client
  • Caret Markdown Editor
  • Nylas Email App
  • Visual Studio Code
  • Slack desktop
  • WordPress desktop app

To get started with developing using the Electron, you need to have Node and npm(node package manager) installed. If you do not already have these, head over to Node setup to install node on your local system. Confirm that node and npm are installed by running the following commands in your terminal.

node –version
npm –version

The above command will generate the following output −

v6.9.1
3.10.8

Whenever we create a project using npm, we need to provide a package.json file, which has all the details about our project. npm makes it easy for us to set up this file. Let us set up our development project.

  • Fire up your terminal/cmd, create a new folder named hello-world and open that folder using the cd command.
  • Now to create the package.json file using npm, use the following command.

npm init

Then it will ask to you for some information

Just keep pressing Enter, and enter your name at the “author name” field.

Create a new folder and open it using the cd command. Now run the following command to install Electron globally.

$ npm install -g electron-prebuilt

Once it executes, you can check if Electron is installed the right way by running the following command −

$ electron –version

Then You should get the output −

v1.4.13

Here setup is Done.Now you can move for creating first app of ELECTRON.