What is Electron?

The website links

Why use Electron?

  • cross-platform
  • A desktop application
  • Low technical difficulty technology stack and rich scaffolding tools on the front end

How about Electron?

How to start?

npm && Node.js

NPM is the Package Manager for Node.js, which is installed when you install Node.js. Node.js provides interfaces to control Windows and system apis. The website links

The environment inside the wall,

Due to the instability of NPM caused by the wall, it is strongly recommended to use taobao CNPM image instead of NPM. Taobao mirror address, too lazy to see directly can CMD + C /v

npm install -g cnpm --registry=https://registry.npm.taobao.org
Copy the code
alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"
Copy the code

Install the Electron

npm install electron --save-dev --save-exact
Copy the code

If you have network problems, please use Taobao mirror.

Demo

Now that the installation is complete, you are advised to use the official recommended API – Demo test. link

git clone https://github.com/electron/electron-api-demos
cd electron-api-demos
npm install
npm start
Copy the code

Let’s start Electron!