Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Electron
  3. electron-is-dev

electron-is-dev

MITJavaScriptv3.0.1

Check if an Electron app is running in development mode, with environment variable override support.

GitHubGitHub
442 stars34 forks0 contributors

What is electron-is-dev?

electron-is-dev is a Node.js package that checks if an Electron application is running in development mode. It solves the problem of conditionally enabling debug features or development-specific behavior without hardcoding environment checks. Developers use it to toggle functionality like enhanced logging, dev tools, or experimental features based on the app's environment.

Target Audience

Electron developers building cross-platform desktop applications who need to differentiate between development and production environments in their main process code.

Value Proposition

It provides a simple, reliable boolean check with the unique ability to override via an environment variable, offering more flexibility than Electron's built-in `app.isPackaged` property for testing scenarios.

Overview

Check if Electron is running in development

Use Cases

Best For

  • Conditionally enabling debug features in Electron apps
  • Adding development-only logging or tools
  • Testing production builds with development behavior
  • Simplifying environment checks in main process code
  • Integrating with preload scripts for renderer access
  • Building Electron utilities that require environment awareness

Not Ideal For

  • Projects that rely exclusively on Electron's native `app.isPackaged` and have no need for environment variable overrides
  • Applications requiring multi-environment detection (e.g., staging, testing, production) beyond a simple boolean check
  • Teams prioritizing minimal dependencies and preferring to use built-in Electron APIs without additional packages

Pros & Cons

Pros

Lightweight and Simple

With zero dependencies and a minimal API, it provides a straightforward boolean check, as emphasized in the README's focus on simplicity.

Environment Variable Override

Allows forcing development mode by setting ELECTRON_IS_DEV=1, offering flexibility for testing production builds locally, a key feature highlighted in the usage section.

Main Process Integration

Designed for the main process with clear guidance on exposing to renderer via preload scripts, ensuring reliable environment detection in core app logic, as detailed in the FAQ.

Compatibility Assurance

Requires Electron 28 or later, ensuring it works with modern versions and avoids compatibility issues, as noted in the installation instructions.

Cons

Renderer Process Complexity

Must be manually exposed via preload scripts for use in the renderer, adding extra setup steps compared to native solutions that might offer built-in access.

Redundant with Native API

Electron's built-in `app.isPackaged` serves a similar purpose, making this package unnecessary for projects that don't benefit from the override feature, as acknowledged in the FAQ.

Limited Environment Scope

Only distinguishes between development and production, lacking support for additional environments like staging or testing without custom logic, which may require supplementary code.

Frequently Asked Questions

Quick Stats

Stars442
Forks34
Contributors0
Open Issues0
Last commit8 months ago
CreatedSince 2016

Tags

#development-tools#utility#node-js#environment-detection#debugging#electron

Built With

J
JavaScript
N
Node.js

Included in

Electron27.1k
Auto-fetched 15 hours ago

Related Projects

rxdbrxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/

Stars23,200
Forks1,167
Last commit18 hours ago
gotgot

🌐 Human-friendly and powerful HTTP request library for Node.js

Stars14,902
Forks984
Last commit9 days ago
electron-builderelectron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box

Stars14,552
Forks1,848
Last commit15 hours ago
NeDBNeDB

The JavaScript Database, for Node.js, nw.js, electron and the browser

Stars13,549
Forks1,019
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub