Check if Electron is running in development
Useful for enabling debug features only during development.
You can use this module directly in both the main and renderer process.
$ npm install electron-is-dev
Requires Electron 3 or later.
const isDev = require('electron-is-dev');
if (isDev) {
console.log('Running in development');
} else {
console.log('Running in production');
}
You can force development mode by setting the ELECTRON_IS_DEV
environment variable to 1
.
- electron-util - Useful utilities for developing Electron apps
- electron-debug - Adds useful debug features to your Electron app
MIT © Sindre Sorhus