1. Introduction of the development framework

background

  • Nw. js and Electron are desktop application frameworks developed based on Node. js
  • They allow developers to build cross-platform desktop applications using HTML, CSS, and JavaScript
  • Nw.js is backed by Gnor Tech and Intel; Electron back lot
  • They build applications that run on Windows, Mac OS and Linux at the same time

Node Introduction

  • Node.js is a programming framework that enables developers to build server-side applications using JavaScript
  • Popular frameworks derived from Node.js: Express, Hapi, Meteor, Sails
  • Node.js can be used to develop desktop applications

What kind of applications do Nw.js and Electron support to create?

  • Electron provides a GitHub repository (awesome-electron) github.com/sindresorhu…
  • Slack: Enterprise communication collaboration tool for audio and video calls – developed using Electron
  • Light Table is a code editor — developed using Nw.js
  • Game Dev Tycoon is a simulation Game
  • Gitter is a service that provides chat room functionality – developed using Nw.js
  • Macaw is a WYSIWYG Web design tool
  • Hyper is a minimalist terminal application — developed using Electron

Node.js desktop applications compared to Web applications

Advantages and disadvantages of Web applications

  • Web applications boom: The rise of open source software has dramatically reduced the cost of distributing and acquiring software, mainly because of the increasing speed of Internet access and the increasing number of people using the Internet.
  • Limitations and challenges of Web applications: The network is not always available, it is not convenient to process large files on the computer, and the security policies of web browsers are limited by large network and browser features.

Advantages of desktop applications

  • Start and run independent of the network
  • Access to the computer’s operating system and hardware resources, as well as read and write to the file system on the user’s computer
  • You can better control the user experience of the software
  • Where is it once the desktop application is installed, without requiring 7✖️ round-the-clock support from a Web server like the Web

3. Difference between Electron and Nw.js

  • Nw.js: is to use HTML as the entry file; Maintain a shared JavaScript context
  • Electron: access files using JavaScript as an entry point; There are multiple independent JavaScript contexts

4, Electron

Introduction and Installation

  • The original name was Atom Shell
  • Electron delegates the responsibility of loading the app view to the JavaScript code
  • Installation:npm install -g electron

Electron characteristics

  • Support for creating multiple Windows
  • Integrated desktop operating system features through shell and Screen apis
  • Obtain the computer power status
  • Prevents the operating system from entering power saving mode
  • Support for creating tray applications
  • Supports the creation of menus and menu items
  • Support to add full keyboard shortcuts for applications
  • Support for automatically updating application code by applying updates
  • Support for reporting program crashes (unique feature)
  • Support custom Dock menu
  • Support for operating system notification
  • Support for creating boot installers for applications

Electron tool

  • Spectron/Devtron — Test debugging tool
  • IO /#get-starte…