electron-is-dev
Advanced tools
Comparing version 0.2.0 to 0.3.0
12
index.js
'use strict'; | ||
const getFromEnv = parseInt(process.env.ELECTRON_IS_DEV, 10) === 1; | ||
const isEnvSet = 'ELECTRON_IS_DEV' in process.env; | ||
const getFromEnv = () => { | ||
if ('ELECTRON_IS_DEV' in process.env) { | ||
return parseInt(process.env.ELECTRON_IS_DEV, 10) === 1; | ||
} | ||
return false; | ||
}; | ||
module.exports = getFromEnv() || process.defaultApp || /[\\/]electron-prebuilt[\\/]/.test(process.execPath) || /[\\/]electron[\\/]/.test(process.execPath); | ||
module.exports = isEnvSet ? getFromEnv : (process.defaultApp || /node_modules[\\/]electron[\\/]/.test(process.execPath)); |
{ | ||
"name": "electron-is-dev", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Check if Electron is running in development", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2689
4