Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionTASTEWINMFile managementDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceInvestingTASTESTOCKStock auto-trading desktop appGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack saferTASTEWINMA keyboard-first file manager with two panes

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Investing

TASTESTOCKStock auto-trading that follows the rules you set: when, and what

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesAbout usPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
Yesterday
Total views
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

Electron docs
Electron
Getting Started with ElectronProject StructureCore ConceptsData and StateTestingDeployment
Discussions

Electron guide · 1/6

Getting Started with Electron

This chapter sets up a development environment and builds a first desktop app from an empty folder. Along the way you will scaffold a project with Electron Forge, the official tooling, and learn how to debug the main process from your editor.

Prepare Node.js

Electron is distributed as an npm package and driven by Node.js tooling, so install a Node.js LTS release first. Note that the Node.js running inside your app is the one embedded in Electron; the Node.js on your machine is used to install packages and run build tools.

node -v
npm -v

If both commands print a version, you are ready. If you ever need to compile native modules, you may also need the C++ build tools for Visual Studio on Windows or the Xcode Command Line Tools on macOS.

Build one by hand

Building a project manually once is the best way to see how the pieces fit together. Create a folder, generate a package.json, and install electron.

mkdir my-electron-app
cd my-electron-app
npm init -y
npm install --save-dev electron

Install electron as a dev dependency. Packaging tools bundle the Electron binary into your finished app themselves, so it does not belong among the runtime dependencies.

Next, point the main field of package.json at your entry file and add a start script. Running electron . reads the package.json in the current folder and launches the file named in main as the main process.

{
  "name": "my-electron-app",
  "version": "1.0.0",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  }
}

Now write the main process in main.js. Once the app is ready (app.whenReady()), it creates a window and loads an HTML file.

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

function createWindow() {
  const win = new BrowserWindow({ width: 800, height: 600 })
  win.loadFile('index.html')
}

app.whenReady().then(() => {
  createWindow()

  // macOS: recreate a window when the dock icon is clicked and none are open
  app.on('activate', () => {
    if (BrowserWindow.getAllWindows().length === 0) createWindow()
  })
})

// Quit when all windows are closed, except on macOS
app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') app.quit()
})

The index.html shown in the window is an ordinary web page. Adding a Content Security Policy from day one keeps unexpected scripts from running.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'" />
    <title>Hello Electron</title>
  </head>
  <body>
    <h1>Hello from Electron</h1>
  </body>
</html>

Run npm start and a desktop window opens with your page.

Scaffold with Electron Forge

For real projects, start with Electron Forge. It ties together scaffolding, running in development, packaging, building installers, and publishing under a single set of commands.

npm init electron-app@latest my-app
cd my-app
npm start

# A template with TypeScript and Vite
npm init electron-app@latest my-ts-app -- --template=vite-typescript

Available templates include webpack, webpack-typescript, vite, and vite-typescript. To add Forge to an existing project, install @electron-forge/cli and run npx electron-forge import.

Editor setup and debugging

Visual Studio Code is a solid choice thanks to its TypeScript support. The renderer (your web page) is debugged with the Chromium DevTools: open them from the View menu of the default application menu, or call win.webContents.openDevTools() in code.

The main process is plain Node.js code, so use a Node.js debugger. In VS Code, add this configuration to .vscode/launch.json and press F5.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Main Process",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
      "windows": {
        "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
      },
      "args": ["."],
      "outputCapture": "std"
    }
  ]
}

From the command line you can run npx electron --inspect=5858 . and attach from chrome://inspect in Chrome. For quick API experiments without a project, try Electron Fiddle, the official playground.

Summary

  • Electron is an npm package installed as a dev dependency.
  • The main field of package.json names the main process entry file, and electron . runs it.
  • The main process creates a BrowserWindow, loads HTML, and follows each platform's quit conventions.
  • Start real projects with npm init electron-app@latest to get an Electron Forge setup.
  • Debug the renderer with DevTools and the main process with --inspect or the VS Code debugger.
Questions about this chapter?
Next chapterProject Structure

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.