{"id":19815355,"url":"https://github.com/myferr/this-is-electron","last_synced_at":"2026-05-18T10:07:29.703Z","repository":{"id":221570061,"uuid":"754760329","full_name":"myferr/this-is-electron","owner":"myferr","description":"An introduction into Electron.JS","archived":false,"fork":false,"pushed_at":"2024-02-09T01:14:55.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T16:53:08.427Z","etag":null,"topics":["course","electronjs","helpful","introduction","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myferr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-08T18:05:24.000Z","updated_at":"2024-05-13T00:41:06.000Z","dependencies_parsed_at":"2024-02-08T19:29:09.003Z","dependency_job_id":"0ea6ddcb-bce4-472d-a43a-5caaf2e0d17a","html_url":"https://github.com/myferr/this-is-electron","commit_stats":null,"previous_names":["myferr/this-is-electron"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/myferr/this-is-electron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myferr%2Fthis-is-electron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myferr%2Fthis-is-electron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myferr%2Fthis-is-electron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myferr%2Fthis-is-electron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myferr","download_url":"https://codeload.github.com/myferr/this-is-electron/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myferr%2Fthis-is-electron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33174091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["course","electronjs","helpful","introduction","javascript"],"created_at":"2024-11-12T10:05:40.088Z","updated_at":"2026-05-18T10:07:29.688Z","avatar_url":"https://github.com/myferr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This is Electron. (An introduction to Electron.js)\n\nElectron is a **JavaScript framework** used for building desktop applications. Using the power of **JavaScript** and web development Electron makes desktop apps.\n\n\u003e index.js - JavaScript\n```javascript\nconst { app, BrowserWindow } = require('electron/main')\n\nconst path = require('node:path')\n\nfunction createWindow () {\n  const win = new BrowserWindow({\n    width: 800,\n    height: 600,\n    webPreferences: {\n      preload: path.join(__dirname, 'preload.js')\n    }\n  })\n\n  win.removeMenu()\n  win.loadFile('./src/gui/index.html')\n}\n\n  \n\napp.whenReady().then(() =\u003e {\n  createWindow()\n\n  app.on('activate', () =\u003e {\n    if (BrowserWindow.getAllWindows().length === 0) {\n      createWindow()\n    }\n  })\n})\n\napp.on('window-all-closed', () =\u003e {\n  if (process.platform !== 'darwin') {\n    app.quit()\n  }\n})\n```\n\nUsing this JavaScript code my HTML file at `./src/gui/index.html` is ran as a desktop app! Turning HTML, CSS and JS into applications for desktop, Electron is super easy to download.\n\n## Downloading Electron\n\u003e Node.JS and NPM are required in order to use Electron.JS\n \nElectron is super easy to download using [NPM](https://www.npmjs.com/)!\n\n◉ Installing NPM\n\n○ [Go here to install NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)\n\n\n◉ Installing Electron.js\n\n○ Enter in your command line `npm install electron`\n\n## Setting up an Electron project\n\nAfter downloading Electron run in your command line `npm init`. This will prompt you with a series of questions on setting up your `package.json`!\n\n\u003cimg src=\"images/Pasted image 20240208115328.png\"\u003e\n\nAfter that you should have two files. Your first file is your `index.js` file and your second file is `package.json`. Inside of your `package.json` you want this in your scripts:\n\n```json\n  \"scripts\": {\n    \"start\": \"electron .\"\n  }\n```\n\nThen after that create a folder called `src` put your `index.js` inside of your `src` folder.\nInside of the `src` folder create a file called `preload.js`, inside of your `preload.js` enter the following code:\n\n```javascript\nwindow.addEventListener('DOMContentLoaded', () =\u003e {\n  const replaceText = (selector, text) =\u003e {\n    const element = document.getElementById(selector)\n    if (element) element.innerText = text\n  }\n  \n  for (const type of ['chrome', 'node', 'electron']) {\n    replaceText(`${type}-version`, process.versions[type])\n  }\n})\n```\n\nAfter that create a folder inside your `src` folder and name it `gui`. Inside of your `gui` folder add your HTML, CSS and JavaScript files and save it all!\n\n\u003cimg src=\"images/Pasted image 20240208115924.png\"\u003e\n\nYou should have your files looking like this now! Go into your terminal and run `npm start`\nthat will start your Electron application!\n\n\u003cimg src=\"images/Pasted image 20240208120115.png\"\u003e\n\u003cimg src=\"images/Pasted image 20240208120144.png\"\u003e\n\n## Learn more about Electron\n\nYou've now learned how to setup a basic Electron application!\nTo learn even more go to the [official documentation for Electron](https://www.electronjs.org/docs/latest/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyferr%2Fthis-is-electron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyferr%2Fthis-is-electron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyferr%2Fthis-is-electron/lists"}