Search by Tags

Electron Framework

 
Applicable for

Compare with Revision
Subscribe for this article updates

Electron is a framework for creating native applications using web technologies like JavaScript, HTML, and CSS. More info here.

Electron Install

Update the system package manager and install some required dependencies and packages:

opkg update
opkg install libxss1 libcups2 nodejs nodejs-npm git

Execute the command “npm init” inside a folder called “electron” to create the package.json file. That will be the repository for the following install. Keep pressing “enter” so "npm init" keeps the default configuration:

mkdir electron
cd electron
npm init
name: (electron)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /home/root/electron/package.json:
{
"name": "electron",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}

Install the pre-built Electron package:

npm install electron-prebuilt

Run Samples

Clone the repository of samples inside a folder:

mkdir Samples
cd Samples
git clone https://github.com/hokein/electron-sample-apps.git

To execute a sample, enter a specific sample directory and execute the command, for instance:

cd electron-sample-apps
cd frameless-window
~/electron/node_modules/.bin/electron .

The videos below present some demos created in Electron: