Check if an Electron app is running in development mode, with environment variable override support.
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.
Electron developers building cross-platform desktop applications who need to differentiate between development and production environments in their main process code.
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.
Check if Electron is running in development
With zero dependencies and a minimal API, it provides a straightforward boolean check, as emphasized in the README's focus on simplicity.
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.
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.
Requires Electron 28 or later, ensuring it works with modern versions and avoids compatibility issues, as noted in the installation instructions.
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.
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.
Only distinguishes between development and production, lacking support for additional environments like staging or testing without custom logic, which may require supplementary code.
A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
🌐 Human-friendly and powerful HTTP request library for Node.js
A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
The JavaScript Database, for Node.js, nw.js, electron and the browser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.