Students Save 30%! Learn & create with unlimited courses & creative assets Students Save 30%! Save Now

1.2 Build a Desktop App With Electron

In this lesson, I’ll show you how to use Electron to build cross-platform desktop apps with web technologies. You’ll see how to start a new Electron project from scratch, and also how to convert an existing Angular 2 project to work on the desktop with Electron.

Code Snippet

This snippet shows how to display a local HTML file with Electron.

const {app, BrowserWindow} = require('electron');

let win;

function createWindow () {
    win = new BrowserWindow({ width: 1280, height: 720, maximizable: true, minimizable: true});
    win.maximize();
    win.loadURL(`file://${__dirname}/index.html`);
}

app.on('ready', createWindow);

Related Links

1.Build a Desktop App With Electron
2 lessons, 13:49

Free Lesson
1.1
Introduction
00:57

1.2
Build a Desktop App With Electron
12:52