Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Desktop apps with Electron, for fun and profit

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →
Dhaya
October 19, 2016

Desktop apps with Electron, for fun and profit

Slides from a talk I gave at an internal R&D event.

The objective was to give an overview and practical use cases for cross-platform applications built with Electron.

Links found in the slides

Slide 20
http://electron.atom.io/apps/
http://www.builtwithelectron.com/
http://electron.atom.io/docs/
http://jlord.us/essential-electron/
https://github.com/electron/electron/

Slide 21
https://blog.codinghorror.com/the-principle-of-least-power/

Dhaya

October 19, 2016

Transcript

21 slides
  1. FEATURES npm run package package.json 1 2 3 4 5

    6 7 8 9 10 ... "scripts": { "start": "electron ./app", "package": "npm run package:linux && npm run package:mac && npm run package:win", "package:linux": "build --linux", "package:mac": "build --mac", "package:win": "build --win --ia32 --x64" }, ...
  2. WORKFLOW main process app.js 1 2 3 4 5 6

    const { app } = require('electron'); app.on('ready', () => { console.log('hello world'); });
  3. WORKFLOW main process renderer process renderer process renderer process app.js

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 const { app, BrowserWindow } = require('electron'); app.on('ready', () => { const mainWindow = new BrowserWindow({ width: 800, height: 600 }); mainWindow.loadURL(__dirname + '/app.html'); mainWindow.on('closed', () => { app.quit(); }); }); ipc
  4. IN APPLICATION app.js 1 2 3 4 5 6 7

    8 9 10 11 12 13 14 15 16 17 const { app, shell } = require('electron'); const Feed = require('./feed'); const Notification = require('./notification'); app.on('ready', () => { Feed.on('new', (article) => { Notification.send({ title: article.title, content: article.author, icon: article.avatar, onclick: () => shell.openExternal(article.url), tray: app.tray }); }); });
  5. FURTHER READING… Apps made with Electron
 http://electron.atom.io/apps/
 http://www.builtwithelectron.com/ Guides, API

    Reference
 http://electron.atom.io/docs/
 http://jlord.us/essential-electron/ Contribute
 https://github.com/electron/electron
  6. Atwood’s Law, 1895 « Any application that can be written

    in JavaScript, will eventually be written in JavaScript » Notice and acknowledgments All product names, logos, and brands are property of their respective owners. All company, product and service names used in this presentation are for identification purposes only. Icons made by Dave Gandy, Freepik, Icomoon, Madebyoliver, TutsPlus, Yannick, from www.flaticon.com.

More Decks by Dhaya

Other Decks in Programming