Book Image

Building Cross-Platform Desktop Applications with Electron

By : Muhammed Jasim
Book Image

Building Cross-Platform Desktop Applications with Electron

By: Muhammed Jasim

Overview of this book

<p>Though web applications are becoming increasingly popular, desktop apps are still important. The Electron framework lets you write cross-platform desktop applications using JavaScript, HTML, and CSS, and this book will teach you how to create your first desktop application with Electron. It will guide you on how to build desktop applications that run on Windows, Mac, and Linux platforms.</p> <p>You will begin your journey with an overview of Electron, and then move on to explore the various stages of creating a simple social media application. Along the way, you will learn how to use advanced Electron APIs, debug an Electron application, and make performance improvements using the Chrome developer tools. You’ll also find out how to package and distribute an application, and more.</p> <p>By the end of the book, you will be able to build a complete desktop application using Electron and web technologies. You will have a solid understanding of the common challenges that desktop app developers face, and you’ll know how to solve them.</p>
Table of Contents (19 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Chapter 1. Introducing Electron

Node.js is an open source cross-platform runtime environment for developing server-side web applications using JavaScript. It uses Google's V8 engine to interpret JavaScript. A variety of web frameworks such as Express and Hapi is available in Node.js. Nowadays, it's very commonly used for tooling purposes on a normal software development cycle. For example, most of the client-side JavaScript frameworks use Node.js to automate various development processes such as build, minify JavaScript, compile source code, and so on. But most people have a false impression that node is all about web applications and for command-line utilities. But the truth is we can use Node.js for almost everything that is possible with other programming languages and platforms.

In this book, we will be discussing how to use Node.js to build desktop applications that run on all major operating systems. You may be wondering about this combination--JavaScript and desktop applications. You may be using this type of application in your daily life. Have you ever used Slack at work? Or are you using GitHub Atom editor or Microsoft Visual Studio Code for editing your source code? Then you have used a Node.js based desktop application. These are some of the classic examples of Node.js based desktop applications.

There are two main choices available for building desktop applications using Node.js and web technologies:

  • NW.js (formerly known as node-WebKit)
  • Electron (formerly known as atom shell)

Both of these frameworks are open source and supported by major companies such as Intel and GitHub. Both have larger communities around them. In this book, we will be exploring building desktop applications using the GitHub Electron framework. Let's look into the internals and architecture of Electron before we get started with application development. In this chapter, we will be discussing the following points:

  • Brief history and introduction of Electron
  • Advantages of Electron over traditional desktop applications
  • Building a hello world application using Electron
  • Integrating a Node.js environment into web pages using Electron
  • Architecture and internal of Electron