Check if Electron is running in development
Clone or download
Latest commit 05ae239 Sep 19, 2018
Permalink
Failed to load latest commit information.
.editorconfig Meta tweaks Jul 23, 2017
.gitattributes Require Electron 3 Sep 19, 2018
.gitignore Meta tweaks Jul 23, 2017
.npmrc Meta tweaks Jul 23, 2017
.travis.yml init Apr 8, 2016
index.js Make it work in the renderer process too (#14) Sep 19, 2018
license Meta tweaks Jul 23, 2017
package.json 1.0.1 Sep 19, 2018
readme.md Readme tweaks Sep 19, 2018

readme.md

electron-is-dev

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.

Install

$ npm install electron-is-dev

Requires Electron 3 or later.

Usage

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.

Related

License

MIT © Sindre Sorhus